Skip to content

Commit

Permalink
fixup! doc: optimize HTML rendering
Browse files Browse the repository at this point in the history
Co-authored-by: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
aduh95 and RaisinTen authored Feb 10, 2021
1 parent 9f3a0af commit d226aca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/doc/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const gtocHTML = unified()
const templatePath = path.join(docPath, 'template.html');
const template = fs.readFileSync(templatePath, 'utf8');

const wrapSections = (content) => {
function wrapSections(content) {
let firstTime = true;
return content.toString()
.replace(/<h2/g, (heading) => {
Expand All @@ -77,7 +77,7 @@ const wrapSections = (content) => {
}
return '</section><section>' + heading;
}) + (firstTime ? '' : '</section>');
};
}

function toHTML({ input, content, filename, nodeVersion, versions }) {
filename = path.basename(filename, '.md');
Expand Down

0 comments on commit d226aca

Please sign in to comment.