toc支持小写占位符

This commit is contained in:
xiaoqi.cxq 2022-09-04 18:28:25 +08:00
parent fc74346b4b
commit f5b4627083
2 changed files with 2 additions and 2 deletions

View File

@ -98,7 +98,7 @@ export default (md) => {
return result;
}, '');
}
if (token.type === 'inline' && token.content === '[TOC]') {
if (token.type === 'inline' && (token.content === '[TOC]' || token.content === '[toc]')) {
tocTokens.push(token);
}
});

View File

@ -107,7 +107,7 @@ export default {
},
};
grammars.main['cn-toc'] = {
pattern: /^\[TOC\]$/gm,
pattern: /^\[(TOC|toc)\]$/gm,
};
for (let i = 6; i >= 1; i -= 1) {
grammars.main[`h${i} cn-head`] = {