Build: remove weird newlines before tables

This commit is contained in:
Ben Edgington
2025-06-26 18:20:16 +01:00
parent 83ca0484e6
commit ecea236b81

View File

@@ -21,6 +21,12 @@ function cleanupHtml() {
return CONTINUE;
}
// Huge numbers of newlines weirdly get inserted before tables - no idea why
if (node.type === 'text' && node.value.match(/^\n\n+$/) !== null) {
node.value = '\n';
return CONTINUE;
}
// Remove all comments
if (node.type === 'comment') {
parent.children.splice(index, 1);