Skip to content

Commit

Permalink
Maybe that works now
Browse files Browse the repository at this point in the history
  • Loading branch information
indigoxela committed Jul 16, 2024
1 parent d04a737 commit eff616b
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions js/plugins/backdropimage/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,10 @@
}
else {
let parent = document.createElement(node.name);
let lastChild = node.lastChild;
while (node = node.walk()) {

Check failure on line 209 in js/plugins/backdropimage/plugin.js

View workflow job for this annotation

GitHub Actions / PHP_CodeSniffer, JSHint

Expected a conditional expression and instead saw an assignment.
if (node.name === 'p') {
// Unclear where these "p" come from.
continue;
}
if (node.name === 'br' && !node.parent) {
// Another riddle - only if there's more than one "br" in a
// figcaption, odd things happen.
// @todo
continue;
}
// Caution, walk() does not only walk over this node, so we have to
// stop ourselves.
if (node.name === '#text') {
if (node.parent.name === parent.nodeName.toLowerCase()) {
parent.append(document.createTextNode(node.value));
Expand All @@ -235,6 +228,10 @@
}
parent.append(nestedElm);
}
if (node === lastChild) {
// Stop before leaving figcaption.
break;
}
}
dummy.append(parent);
}
Expand Down

0 comments on commit eff616b

Please sign in to comment.