Skip to content

NOW MANAGED ON CODEBERG

WYSIWYG: Fixed filtering issue causing broken page edits

Dan Brown2c20abc87245
diff --git a/resources/js/wysiwyg/filters.js b/resources/js/wysiwyg/filters.js
index 4dd600630..dee5df4c2 100644
--- a/resources/js/wysiwyg/filters.js
+++ b/resources/js/wysiwyg/filters.js
@@ -24,7 +24,9 @@ function setupBrFilter(editor) {
function setupPointerFilter(editor) {
editor.parser.addNodeFilter('div', nodes => {
for (const node of nodes) {
- if (node.attr('id') === 'pointer' || node.attr('class').includes('pointer')) {
+ const id = node.attr('id') || '';
+ const nodeClass = node.attr('class') || '';
+ if (id === 'pointer' || nodeClass.includes('pointer')) {
node.remove();
}
}