We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71b9fe2 commit 15e3d7fCopy full SHA for 15e3d7f
highlight-helper.js
@@ -1112,7 +1112,7 @@ function Highlighter(options = hhDefaultOptions) {
1112
const ancestorElementsInRange = [];
1113
for (const paragraph of paragraphs) {
1114
let element = paragraph;
1115
- while (element !== range.commonAncestorContainer) {
+ while (range.commonAncestorContainer.contains(element)) {
1116
if (!ancestorElementsInRange.includes(element)) ancestorElementsInRange.push(element);
1117
element = element.parentElement;
1118
}
0 commit comments