Skip to content

Commit 9318136

Browse files
committed
Update codeit.js
1 parent 88ba155 commit 9318136

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/codeit.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,21 @@ class CodeitElement extends HTMLElement {
10131013

10141014
}
10151015

1016+
// if range at start of newline container (at end of line)
1017+
if (container.nodeValue.startsWith('\n') &&
1018+
range.startOffset === 0) {
1019+
1020+
// check previous element
1021+
if (container.previousSibling.nodeType === 1 && // previous sibling is an element
1022+
container.previousSibling
1023+
.classList.contains(className)) {
1024+
1025+
return true;
1026+
1027+
}
1028+
1029+
}
1030+
10161031
return false;
10171032

10181033
}

0 commit comments

Comments
 (0)