Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export: function (path, html, font, indent, callback) {
let currentParagraph = null;
let boldActive = false;
let italicsActive = false;
let underlineActive = false;
let strikeActive = false;
let orderedListActive = false;
let unorderedListActive = false;
let h1counter = 0;
let h2counter = 0;
let h3counter = 0;
const numbering = new docx.Numbering();
const numberedAbstract = numbering.createAbstractNumbering();
numberedAbstract.createLevel(0, 'decimal', '%1. ', 'left');
const letterNumbering = numbering.createConcreteNumbering(numberedAbstract);
// Create document
let doc = new docx.Document();
var parser = new htmlparser.Parser({
onopentag: function (name, attribs) {
if (name === 'exporttitle') {
currentParagraph = new docx.Paragraph();
currentParagraph.center();
currentParagraph.spacing(exportitlespacing);
boldActive = true;