Skip to content

Commit 2cbfb9c

Browse files
committed
fix comments.
1 parent 5ad8c2c commit 2cbfb9c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/core/render/compiler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import marked from 'marked';
12
import { isAbsolutePath, getPath, getParentPath } from '../router/util';
23
import { isFn, merge, cached, isPrimitive } from '../util/core';
34
import { tree as treeTpl } from './tpl';
@@ -11,7 +12,6 @@ import { paragraphCompiler } from './compiler/paragraph';
1112
import { taskListCompiler } from './compiler/taskList';
1213
import { taskListItemCompiler } from './compiler/taskListItem';
1314
import { linkCompiler } from './compiler/link';
14-
import marked from 'marked';
1515

1616
const cachedLinks = {};
1717

@@ -216,7 +216,7 @@ export class Compiler {
216216

217217
if (/{docsify-ignore}/g.test(str)) {
218218
str = str.replace('{docsify-ignore}', '');
219-
nextToc.title = str;
219+
nextToc.title = removeAtag(str);
220220
nextToc.ignoreSubHeading = true;
221221
}
222222

@@ -228,7 +228,7 @@ export class Compiler {
228228

229229
if (/{docsify-ignore-all}/g.test(str)) {
230230
str = str.replace('{docsify-ignore-all}', '');
231-
nextToc.title = str;
231+
nextToc.title = removeAtag(str);
232232
nextToc.ignoreAllSubs = true;
233233
}
234234

src/core/render/compiler/headline.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
import { getAndRemoveConfig } from '../utils';
1+
import { getAndRemoveConfig, removeAtag } from '../utils';
22
import { slugify } from './slugify';
33

44
export const headingCompiler = ({ renderer, router, _self }) =>
55
(renderer.code = (text, level) => {
66
let { str, config } = getAndRemoveConfig(text);
7-
const nextToc = { level, title: str };
7+
const nextToc = { level, title: removeAtag(str) };
88

99
if (/<!-- {docsify-ignore} -->/g.test(str)) {
1010
str = str.replace('<!-- {docsify-ignore} -->', '');
11-
nextToc.title = str;
11+
nextToc.title = removeAtag(str);
1212
nextToc.ignoreSubHeading = true;
1313
}
1414

1515
if (/{docsify-ignore}/g.test(str)) {
1616
str = str.replace('{docsify-ignore}', '');
17-
nextToc.title = str;
17+
nextToc.title = removeAtag(str);
1818
nextToc.ignoreSubHeading = true;
1919
}
2020

2121
if (/<!-- {docsify-ignore-all} -->/g.test(str)) {
2222
str = str.replace('<!-- {docsify-ignore-all} -->', '');
23-
nextToc.title = str;
23+
nextToc.title = removeAtag(str);
2424
nextToc.ignoreAllSubs = true;
2525
}
2626

2727
if (/{docsify-ignore-all}/g.test(str)) {
2828
str = str.replace('{docsify-ignore-all}', '');
29-
nextToc.title = str;
29+
nextToc.title = removeAtag(str);
3030
nextToc.ignoreAllSubs = true;
3131
}
3232

0 commit comments

Comments
 (0)