File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -916,10 +916,8 @@ function Highlighter(options = hhDefaultOptions) {
916916
917917 // Bring active highlight to the front
918918 const svgHighlight = svgBackground . querySelector ( `g[data-highlight-id="${ activeHighlightId } "]` ) ;
919- if ( svgHighlight ) {
920- svgBackground . appendChild ( svgHighlight ) ;
921- svgBackground . appendChild ( svgActiveOverlay ) ;
922- }
919+ if ( svgHighlight ) svgBackground . appendChild ( svgHighlight ) ;
920+ svgBackground . appendChild ( svgActiveOverlay ) ;
923921 }
924922
925923 if ( changeType === 'appearance' ) {
@@ -1014,7 +1012,7 @@ function Highlighter(options = hhDefaultOptions) {
10141012
10151013 // Prevent the range from starting or ending in an element that doesn't match the paragraph selector
10161014 if ( this . annotatableContainer . contains ( range . commonAncestorContainer ) && ( ! startNode . parentElement . closest ( options . paragraphSelector ) || ! endNode . parentElement . closest ( options . paragraphSelector ) ) ) {
1017- let annotatableParagraphsInRange = Array . from ( this . annotatableParagraphs ) . filter ( ( paragraph ) => {
1015+ const annotatableParagraphsInRange = Array . from ( this . annotatableParagraphs ) . filter ( ( paragraph ) => {
10181016 const relativeStartPosition = startNode . compareDocumentPosition ( paragraph ) ;
10191017 const relativeEndPosition = endNode . compareDocumentPosition ( paragraph ) ;
10201018 return ( relativeStartPosition & Node . DOCUMENT_POSITION_FOLLOWING || relativeStartPosition & Node . DOCUMENT_POSITION_CONTAINS ) && ( relativeEndPosition & Node . DOCUMENT_POSITION_PRECEDING || relativeEndPosition & Node . DOCUMENT_POSITION_CONTAINS ) ;
You can’t perform that action at this time.
0 commit comments