File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed
app/components/sandbox/CodeEditor Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ const highlightLines = (
205205 highlightedLines : Array < string >
206206) => {
207207 highlightedLines . forEach ( line => {
208- cm . addLineClass ( + line , 'background' , 'cm-line-highlight' ) ;
208+ cm . addLineClass ( + line - 1 , 'background' , 'cm-line-highlight' ) ;
209209 } ) ;
210210} ;
211211
Original file line number Diff line number Diff line change @@ -20,12 +20,8 @@ export const getSandboxOptions = (url: string) => {
2020 }
2121
2222 const highlightMatch = url . match ( / ( \? | & ) ( h i g h l i g h t s ) = ( [ ^ & ] + ) / ) ;
23- if ( highlightMatch ) {
24- const lineHighlightsMatch = highlightMatch [ 3 ] . match ( / { ( .* ) } / ) ;
25-
26- if ( lineHighlightsMatch ) {
27- result . highlightedLines = lineHighlightsMatch [ 1 ] . split ( ',' ) ;
28- }
23+ if ( highlightMatch && highlightMatch [ 3 ] ) {
24+ result . highlightedLines = highlightMatch [ 3 ] . split ( ',' ) ;
2925 }
3026
3127 const editorSizeMatch = url . match ( / ( \? | & ) ( e d i t o r s i z e ) = ( [ ^ & ] + ) / ) ;
You can’t perform that action at this time.
0 commit comments