mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-09 18:40:06 +00:00
WYSIWYG: Fixed filtering issue causing broken page edits
Could error upon div elements without classes, including drawings. Related to #4510 and #4509
This commit is contained in:
parent
2abbcf5c0f
commit
2c20abc872
1 changed files with 3 additions and 1 deletions
|
@ -24,7 +24,9 @@ function setupBrFilter(editor) {
|
||||||
function setupPointerFilter(editor) {
|
function setupPointerFilter(editor) {
|
||||||
editor.parser.addNodeFilter('div', nodes => {
|
editor.parser.addNodeFilter('div', nodes => {
|
||||||
for (const node of 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();
|
node.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue