Skip to content

Commit 2c20abc

Browse files
committed
WYSIWYG: Fixed filtering issue causing broken page edits
Could error upon div elements without classes, including drawings. Related to #4510 and #4509
1 parent 2abbcf5 commit 2c20abc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

resources/js/wysiwyg/filters.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ function setupBrFilter(editor) {
2424
function setupPointerFilter(editor) {
2525
editor.parser.addNodeFilter('div', nodes => {
2626
for (const node of nodes) {
27-
if (node.attr('id') === 'pointer' || node.attr('class').includes('pointer')) {
27+
const id = node.attr('id') || '';
28+
const nodeClass = node.attr('class') || '';
29+
if (id === 'pointer' || nodeClass.includes('pointer')) {
2830
node.remove();
2931
}
3032
}

0 commit comments

Comments
 (0)