|
|
|
@ -9,16 +9,14 @@ export default function (node, renderer, _options) {
|
|
|
|
let text = node.data;
|
|
|
|
let text = node.data;
|
|
|
|
if (node.use_space()) {
|
|
|
|
if (node.use_space()) {
|
|
|
|
text = ' ';
|
|
|
|
text = ' ';
|
|
|
|
}
|
|
|
|
} else if (
|
|
|
|
else if (!node.parent ||
|
|
|
|
!node.parent ||
|
|
|
|
node.parent.type !== 'Element' ||
|
|
|
|
node.parent.type !== 'Element' ||
|
|
|
|
(( /** @type {import('../../nodes/Element.js').default} */(node.parent)).name !== 'script' && ( /** @type {import('../../nodes/Element.js').default} */(node.parent)).name !== 'style')) {
|
|
|
|
(/** @type {import('../../nodes/Element.js').default} */ (node.parent).name !== 'script' &&
|
|
|
|
|
|
|
|
/** @type {import('../../nodes/Element.js').default} */ (node.parent).name !== 'style')
|
|
|
|
|
|
|
|
) {
|
|
|
|
// unless this Text node is inside a <script> or <style> element, escape &,<,>
|
|
|
|
// unless this Text node is inside a <script> or <style> element, escape &,<,>
|
|
|
|
text = escape_html(text);
|
|
|
|
text = escape_html(text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
renderer.add_string(text);
|
|
|
|
renderer.add_string(text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|