File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ export class Compiler {
82
82
this . contentBase = router . getBasePath ( )
83
83
84
84
const renderer = this . _initRenderer ( )
85
+ this . heading = renderer . heading
85
86
let compile
86
87
const mdConf = config . markdown || { }
87
88
@@ -403,6 +404,10 @@ export class Compiler {
403
404
return treeTpl ( tree )
404
405
}
405
406
407
+ header ( text , level ) {
408
+ return this . heading ( text , level )
409
+ }
410
+
406
411
article ( text ) {
407
412
return this . compile ( text )
408
413
}
Original file line number Diff line number Diff line change @@ -117,9 +117,9 @@ export function renderMixin(proto) {
117
117
const main = dom . getNode ( '#main' )
118
118
const firstNode = main . children [ 0 ]
119
119
if ( firstNode && firstNode . tagName !== 'H1' ) {
120
- const h1 = dom . create ( 'h1' )
121
- h1 . innerText = activeEl . innerText
122
- dom . before ( main , h1 )
120
+ const h1 = this . compiler . header ( activeEl . innerText , 1 )
121
+ const wrapper = dom . create ( 'div' , h1 )
122
+ dom . before ( main , wrapper . children [ 0 ] )
123
123
}
124
124
}
125
125
You can’t perform that action at this time.
0 commit comments