@@ -5,7 +5,7 @@ import { tree as treeTpl } from './tpl';
55import { genTree } from './gen-tree' ;
66import { slugify } from './slugify' ;
77import { emojify } from './emojify' ;
8- import { getAndRemoveConfig } from './utils' ;
8+ import { getAndRemoveConfig , removeAtag } from './utils' ;
99import { imageCompiler } from './compiler/image' ;
1010import { highlightCodeCompiler } from './compiler/code' ;
1111import { paragraphCompiler } from './compiler/paragraph' ;
@@ -206,29 +206,29 @@ export class Compiler {
206206 */
207207 origin . heading = renderer . heading = function ( text , level ) {
208208 let { str, config } = getAndRemoveConfig ( text ) ;
209- const nextToc = { level, title : str } ;
209+ const nextToc = { level, title : removeAtag ( str ) } ;
210210
211211 if ( / < ! - - { docsify-i g n o r e } - - > / g. test ( str ) ) {
212212 str = str . replace ( '<!-- {docsify-ignore} -->' , '' ) ;
213- nextToc . title = str ;
213+ nextToc . title = removeAtag ( str ) ;
214214 nextToc . ignoreSubHeading = true ;
215215 }
216216
217217 if ( / { d o c s i f y - i g n o r e } / g. test ( str ) ) {
218218 str = str . replace ( '{docsify-ignore}' , '' ) ;
219- nextToc . title = str ;
219+ nextToc . title = removeAtag ( str ) ;
220220 nextToc . ignoreSubHeading = true ;
221221 }
222222
223223 if ( / < ! - - { docsify-i g n o r e - a l l } - - > / g. test ( str ) ) {
224224 str = str . replace ( '<!-- {docsify-ignore-all} -->' , '' ) ;
225- nextToc . title = str ;
225+ nextToc . title = removeAtag ( str ) ;
226226 nextToc . ignoreAllSubs = true ;
227227 }
228228
229229 if ( / { d o c s i f y - i g n o r e - a l l } / 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
0 commit comments