终审编委信息
This commit is contained in:
23
scripts/test-footer.cjs
Normal file
23
scripts/test-footer.cjs
Normal file
@@ -0,0 +1,23 @@
|
||||
const { Document, Packer } = require('docx');
|
||||
const JSZip = require('jszip');
|
||||
const { buildManuscriptPageFooter, patchManuscriptPageFootersToXml } = require('../src/utils/exportManuscriptWordFooter.js');
|
||||
|
||||
(async function () {
|
||||
const footer = buildManuscriptPageFooter({
|
||||
journal: { website: 'https://www.tmrjournals.com/bmec' }
|
||||
});
|
||||
const doc = new Document({
|
||||
sections: [
|
||||
{
|
||||
properties: {},
|
||||
footers: { default: footer },
|
||||
children: []
|
||||
}
|
||||
]
|
||||
});
|
||||
const buf = await Packer.toBuffer(doc);
|
||||
let xml = await (await JSZip.loadAsync(buf)).file('word/footer1.xml').async('string');
|
||||
console.log('BEFORE PATCH\n', xml);
|
||||
xml = patchManuscriptPageFootersToXml(xml);
|
||||
console.log('AFTER PATCH\n', xml);
|
||||
})();
|
||||
Reference in New Issue
Block a user