Skip to content

Commit 27276cc

Browse files
committed
fix 'highlight_args' init
1 parent 48a42f7 commit 27276cc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

jupyter_sphinx/execute.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,8 @@ def apply(self):
416416

417417
if linenos_config or continue_linenos or node["linenos"]:
418418
source["linenos"] = True
419-
420-
highlight_args = source['highlight_args'] = {}
421-
422419
if continue_linenos:
423-
highlight_args['linenostart'] = linenostart
420+
source['highlight_args'] = {'linenostart': linenostart}
424421
linenostart += nlines
425422

426423
emphasize_linespec = node['emphasize_lines']
@@ -431,6 +428,7 @@ def apply(self):
431428
'Line number spec is out of range(1-{}): {}'.format(
432429
nlines, emphasize_linespec), location=node['_location'])
433430
hl_lines = [i + 1 for i in hl_lines if i < nlines]
431+
highlight_args = source.setdefault('highlight_args', {})
434432
highlight_args['hl_lines'] = hl_lines
435433

436434
# Add code cell CSS class

0 commit comments

Comments
 (0)