-
Notifications
You must be signed in to change notification settings - Fork 120
Open
Description
There's an issue with having # in code blocks.
The following fixes the TOC in generators.ts
:
const generateToc = {
name: "toc",
regex: placeholderRegexCallback("template:toc"),
template: tocTemplate,
params: ({
config,
blueprint
}) => {
const codeBlockRegex = /(```.+?```)/gms // NEW CODE
const titles = blueprint.replace(codeBlockRegex, '').match(/^[#]{1,6} .*$/gm); // NEW CODE
// const titles = blueprint.replace(codeBlockRegex, '').match(/^[#]{1,6} .*$/gm); // OLD CODE
if (titles == null) {
return {
error: "it could not find any titles"
};
}
return {
titles,
config
};
}
};
However, I was unable to figure out where the section seperator was being injected so this bug still needs to be fixed.
I appreciate your work. Thank you.
Metadata
Metadata
Assignees
Labels
No labels