File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -222,13 +222,15 @@ function updateSelection() {
222222
223223 outputs . forEach ( code => {
224224 const thisNode = code ;
225- const fromLine = parseInt ( thisNode . getAttribute ( 'data-from-line' ) , 10 ) ;
226- const toLine = parseInt ( thisNode . getAttribute ( 'data-to-line' ) , 10 ) ;
227- if ( ( fromLine <= selectedTo ) && ( toLine >= selectedFrom ) ) {
228- code . classList . add ( 'highlight' ) ;
229- code . scrollIntoView ( { block : 'nearest' , inline : 'start' } ) ;
230- } else {
231- code . classList . remove ( 'highlight' ) ;
225+ if ( thisNode . getAttribute ) {
226+ const fromLine = parseInt ( thisNode . getAttribute ( 'data-from-line' ) , 10 ) ;
227+ const toLine = parseInt ( thisNode . getAttribute ( 'data-to-line' ) , 10 ) ;
228+ if ( ( fromLine <= selectedTo ) && ( toLine >= selectedFrom ) ) {
229+ code . classList . add ( 'highlight' ) ;
230+ code . scrollIntoView ( { block : 'nearest' , inline : 'start' } ) ;
231+ } else {
232+ code . classList . remove ( 'highlight' ) ;
233+ }
232234 }
233235 } ) ;
234236}
You can’t perform that action at this time.
0 commit comments