File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,6 @@ inlineTokenRules['inline'] = (token, context) => {
113113inlineTokenRules [ 'html_inline' ] = ( token , context ) => {
114114 const fragment = parse5 . parseFragment ( context . inlineHtmlContext , token . content ) ;
115115 if ( fragment . childNodes && fragment . childNodes . length ) {
116- context . inlineHtmlContext = fragment . childNodes [ 0 ] ;
117116 const node = fragment . childNodes [ 0 ] ;
118117 let style : StyleDefinition = { } ;
119118
@@ -137,6 +136,11 @@ inlineTokenRules['html_inline'] = (token, context) => {
137136 break ;
138137 case 'span' :
139138 break ;
139+ case '#comment' :
140+ // Depending on spacing, comment blocks
141+ // sometimes appear as inline elements
142+ fullTokenRules [ 'html_block' ] ( token , context ) ;
143+ return
140144 default :
141145 throw new Error ( 'Unsupported inline HTML element: ' + node . nodeName ) ;
142146 }
@@ -146,7 +150,7 @@ inlineTokenRules['html_inline'] = (token, context) => {
146150 let css = parseInlineStyle ( styleAttr . value ) ;
147151 updateStyleDefinition ( css , style ) ;
148152 }
149-
153+ context . inlineHtmlContext = fragment . childNodes [ 0 ] ;
150154 context . startStyle ( style ) ;
151155 } else {
152156 context . endStyle ( ) ;
You can’t perform that action at this time.
0 commit comments