We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 517c3c1 commit 6ddaa70Copy full SHA for 6ddaa70
docs/.vitepress/theme/anchor/titleAnchorPreprocessor.ts
@@ -4,7 +4,14 @@ import slugifyTitle from "./slugify";
4
export const titleAnchorPreprocessor = (md: MarkdownIt) => {
5
md.core.ruler.before('normalize', 'title-anchor', (state) => {
6
const lines = state.src.split("\n");
7
+ let inCodeBlock = false;
8
const processedLines = lines.map((line) => {
9
+ if (line.startsWith("```")) {
10
+ inCodeBlock = !inCodeBlock;
11
+ }
12
+ if (inCodeBlock) {
13
+ return line;
14
15
if (line.startsWith("#")) {
16
const title = line.replace(new RegExp("#", "g"), "");
17
const processedTitle = (line.includes("{") && line.includes("}")) ?
0 commit comments