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,11 +206,11 @@ 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-i g n o r e } - - > / 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
@@ -222,7 +222,7 @@ export class Compiler {
222
222
223
223
if ( / < ! - - { docsify-i g n o r e - a l l } - - > / g. test ( str ) ) {
224
224
str = str . replace ( '<!-- {docsify-ignore-all} -->' , '' ) ;
225
- nextToc . title = str ;
225
+ nextToc . title = removeAtag ( str ) ;
226
226
nextToc . ignoreAllSubs = true ;
227
227
}
228
228
0 commit comments