@@ -345,7 +345,7 @@ export function parse(data: string, config: Config = {}): Result {
345
345
. replace ( re ( r `^ (:+) (.+?) $` ) , ( _ , lvl , content ) => {
346
346
if ( content . includes ( '{{' ) ) return _ ;
347
347
const depth = lvl . length ;
348
- return `${ '<dl>' . repeat ( depth ) } <dd>${ content } </dd>${ '</dl>' . repeat ( depth ) } `
348
+ return `${ '<dl>' . repeat ( depth ) } <dd>${ content } </dd>${ '</dl>' . repeat ( depth ) } ` ;
349
349
} )
350
350
. replace ( re ( r `^ ; (.+) $` ) , '<dl><dt>$1</dt></dl>' )
351
351
. replace ( re ( r `</dl> (\s*?) <dl>` ) , '$1' )
@@ -375,7 +375,7 @@ export function parse(data: string, config: Config = {}): Result {
375
375
376
376
const refData = { ref : text , id : refs . length + 1 , name : refname , i : 0 } ;
377
377
refs . push ( refData ) ;
378
- return `<sup class="refnote"><a id="cite-${ refData . id } " class="ref" href="#ref-${ refData . id } ">[${ refData . id } ]</a></sup>`
378
+ return `<sup class="refnote"><a id="cite-${ refData . id } " class="ref" href="#ref-${ refData . id } ">[${ refData . id } ]</a></sup>` ;
379
379
} )
380
380
. replace ( re ( r `< ref \s* name \s* = \s* ["']? ( [^>"']+ ) ["']? \s* (?: /> | > .*? </ref> )` ) , ( _ , refname ) => {
381
381
const ref = refs . find ( ref => ref . name === refname ) ;
@@ -387,7 +387,7 @@ export function parse(data: string, config: Config = {}): Result {
387
387
[${ ref . id } ]
388
388
</a>
389
389
</sup>
390
- ` ;
390
+ ` . trim ( ) ;
391
391
return content ;
392
392
} )
393
393
@@ -414,7 +414,7 @@ export function parse(data: string, config: Config = {}): Result {
414
414
let multiRefContent = '' ;
415
415
if ( refdata . i > 0 ) {
416
416
for ( let i = 0 ; i <= refdata . i ; i ++ ) {
417
- multiRefContent += `<sup><a href="#cite-${ refdata . id } ${ i > 0 ? `_${ i } ` : '' } ">${ i + 1 } </a></sup>` ;
417
+ multiRefContent += `<sup><a href="#cite-${ refdata . id } ${ i > 0 ? `_${ i } ` : '' } ">${ i + 1 } </a></sup> ` ;
418
418
}
419
419
}
420
420
const refline = `
0 commit comments