Skip to content

Commit c1d5844

Browse files
committed
Allow speaker notes in inline html too (make less sensitive to spacing)
1 parent 7810327 commit c1d5844

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/parser/extract_slides.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ inlineTokenRules['inline'] = (token, context) => {
113113
inlineTokenRules['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();

0 commit comments

Comments
 (0)