docs: use BrowserWindow for Markdown demos (#6215)

This commit is contained in:
Joshua Chen 2021-12-29 13:49:09 +08:00 committed by GitHub
parent 5132ecdeee
commit 0fa091a0c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 101 additions and 32 deletions

View file

@ -134,14 +134,10 @@ const plugin = (options) => {
let number = 1;
visit(ast, 'heading', (node) => {
if (node.depth === 2 && node.children.length > 0) {
if (node.children[0].type === 'text') {
node.children[0].value = `Section ${number}. ${node.children[0].value}`;
} else {
node.children.unshift({
type: 'text',
value: `Section ${number}. `,
});
}
node.children.unshift({
type: 'text',
value: `Section ${number}. `,
});
number++;
}
});