Skip to content

Commit 0c54a2f

Browse files
authored
Merge pull request #160 from highcharts-for-python/bugfix/159-sharedoptions-serializing-to-improper-js-literal
Implemented bugfix for SharedOptions serialization in Jupyter context. Closes #159
2 parents 83c5d03 + 9cf03ce commit 0c54a2f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

highcharts_core/utility_functions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ def prep_js_for_jupyter(js_str,
527527
"""document.addEventListener('DOMContentLoaded', function() {""", '')
528528
js_str = js_str.replace('renderTo = ', '')
529529
js_str = js_str.replace(',\noptions = ', ',\n')
530-
js_str = js_str[:-3]
530+
if '.setOptions(' not in js_str:
531+
js_str = js_str[:-3]
531532

532533
if random_slug:
533534
function_str = f"""function insertChart_{random_slug}() """

0 commit comments

Comments
 (0)