|
1 |
| -import marked from 'marked'; |
2 | 1 | import { isAbsolutePath, getPath, getParentPath } from '../router/util';
|
3 | 2 | import { isFn, merge, cached, isPrimitive } from '../util/core';
|
4 | 3 | import { tree as treeTpl } from './tpl';
|
5 | 4 | import { genTree } from './gen-tree';
|
6 | 5 | import { slugify } from './slugify';
|
7 | 6 | import { emojify } from './emojify';
|
8 |
| -import { getAndRemoveConfig } from './utils'; |
| 7 | +import { getAndRemoveConfig, removeAtag } from './utils'; |
9 | 8 | import { imageCompiler } from './compiler/image';
|
10 | 9 | import { highlightCodeCompiler } from './compiler/code';
|
11 | 10 | import { paragraphCompiler } from './compiler/paragraph';
|
12 | 11 | import { taskListCompiler } from './compiler/taskList';
|
13 | 12 | import { taskListItemCompiler } from './compiler/taskListItem';
|
14 | 13 | import { linkCompiler } from './compiler/link';
|
| 14 | +import marked from 'marked'; |
15 | 15 |
|
16 | 16 | const cachedLinks = {};
|
17 | 17 |
|
@@ -206,17 +206,17 @@ export class Compiler {
|
206 | 206 | */
|
207 | 207 | origin.heading = renderer.heading = function(text, level) {
|
208 | 208 | let { str, config } = getAndRemoveConfig(text);
|
209 |
| - const nextToc = { level, title: str }; |
| 209 | + const nextToc = { level, title: removeAtag(str) }; |
210 | 210 |
|
211 | 211 | if (/<!-- {docsify-ignore} -->/g.test(str)) {
|
212 | 212 | str = str.replace('<!-- {docsify-ignore} -->', '');
|
213 |
| - nextToc.title = str; |
| 213 | + nextToc.title = removeAtag(str); |
214 | 214 | nextToc.ignoreSubHeading = true;
|
215 | 215 | }
|
216 | 216 |
|
217 | 217 | if (/<!-- {docsify-ignore-all} -->/g.test(str)) {
|
218 | 218 | str = str.replace('<!-- {docsify-ignore-all} -->', '');
|
219 |
| - nextToc.title = str; |
| 219 | + nextToc.title = removeAtag(str); |
220 | 220 | nextToc.ignoreAllSubs = true;
|
221 | 221 | }
|
222 | 222 |
|
|
0 commit comments