refactor: make conditions more robust

pull/3398/head
Divyansh Singh 2 years ago
parent 1c9f2aa8e4
commit 176c4008c5

@ -169,6 +169,8 @@ export async function highlight(
if ( if (
span.type === 'element' && span.type === 'element' &&
span.tagName === 'span' && span.tagName === 'span' &&
Array.isArray(span.properties.class) &&
span.properties.class.includes('line') &&
span.children.length === 0 span.children.length === 0
) { ) {
span.children.push({ span.children.push({

Loading…
Cancel
Save