File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ export class Compiler {
8282 this . contentBase = router . getBasePath ( )
8383
8484 const renderer = this . _initRenderer ( )
85+ this . heading = renderer . heading
8586 let compile
8687 const mdConf = config . markdown || { }
8788
@@ -403,6 +404,10 @@ export class Compiler {
403404 return treeTpl ( tree )
404405 }
405406
407+ header ( text , level ) {
408+ return this . heading ( text , level )
409+ }
410+
406411 article ( text ) {
407412 return this . compile ( text )
408413 }
Original file line number Diff line number Diff line change @@ -117,9 +117,9 @@ export function renderMixin(proto) {
117117 const main = dom . getNode ( '#main' )
118118 const firstNode = main . children [ 0 ]
119119 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 ] )
123123 }
124124 }
125125
You can’t perform that action at this time.
0 commit comments