File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 77const customTranslators = {
88 DIV : ( { visitor } ) => ( {
99 surroundingNewlines : 2 ,
10- postprocess : ( { nodeMetadata, node } ) => {
10+ postprocess : ( { content , nodeMetadata, node } ) => {
1111 // <div class="admonitionblock note">
1212 if ( node . classList . contains ( 'admonitionblock' ) ) {
1313
@@ -16,13 +16,11 @@ const customTranslators = {
1616 find ( v => v != 'admonitionblock' ) || 'NOTE'
1717 ) . toUpperCase ( )
1818
19- const content = (
20- nhm . translate (
21- node . querySelector ( 'td:nth-child(2)' )
22- . innerHTML
23- ) . replace ( / ^ / mg, '> ' ) )
19+ const admonition = node . querySelector ( 'td:nth-child(2)' ) ?. innerHTML || `BAD ADMONITION ${ content } `
20+ const body = (
21+ nhm . translate ( admonition ) . replace ( / ^ / mg, '> ' ) )
2422
25- return `> [!${ type } ]\n${ content } `
23+ return `> [!${ type } ]\n${ body } `
2624 }
2725 }
2826 } )
You can’t perform that action at this time.
0 commit comments