Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bece9eb

Browse filesBrowse files
committed
Specify utf-8 in script tag
1 parent 8a151e1 commit bece9eb
Copy full SHA for bece9eb

File tree

Expand file treeCollapse file tree

3 files changed

+6
-6
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+6
-6
lines changed

‎packages/python/plotly/plotly/io/_html.py

Copy file name to clipboardExpand all lines: packages/python/plotly/plotly/io/_html.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,23 +272,23 @@ def to_html(
272272
elif include_plotlyjs == "cdn":
273273
load_plotlyjs = """\
274274
{win_config}
275-
<script src="{cdn_url}"></script>\
275+
<script charset="utf-8" src="{cdn_url}"></script>\
276276
""".format(
277277
win_config=_window_plotly_config, cdn_url=plotly_cdn_url()
278278
)
279279

280280
elif include_plotlyjs == "directory":
281281
load_plotlyjs = """\
282282
{win_config}
283-
<script src="plotly.min.js"></script>\
283+
<script charset="utf-8" src="plotly.min.js"></script>\
284284
""".format(
285285
win_config=_window_plotly_config
286286
)
287287

288288
elif isinstance(include_plotlyjs, str) and include_plotlyjs.endswith(".js"):
289289
load_plotlyjs = """\
290290
{win_config}
291-
<script src="{url}"></script>\
291+
<script charset="utf-8" src="{url}"></script>\
292292
""".format(
293293
win_config=_window_plotly_config, url=include_plotlyjs_orig
294294
)

‎packages/python/plotly/plotly/tests/test_core/test_offline/test_offline.py

Copy file name to clipboardExpand all lines: packages/python/plotly/plotly/tests/test_core/test_offline/test_offline.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
<script type="text/javascript">\
4242
window.PlotlyConfig = {MathJaxConfig: 'local'};</script>"""
4343

44-
cdn_script = '<script src="{cdn_url}"></script>'.format(cdn_url=plotly_cdn_url())
44+
cdn_script = '<script charset="utf-8" src="{cdn_url}"></script>'.format(cdn_url=plotly_cdn_url())
4545

46-
directory_script = '<script src="plotly.min.js"></script>'
46+
directory_script = '<script charset="utf-8" src="plotly.min.js"></script>'
4747

4848

4949
mathjax_cdn = "https://cdnjs.cloudflare.com" "/ajax/libs/mathjax/2.7.5/MathJax.js"

‎packages/python/plotly/plotly/tests/test_io/test_renderers.py

Copy file name to clipboardExpand all lines: packages/python/plotly/plotly/tests/test_io/test_renderers.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def test_repr_html(renderer):
311311
template = (
312312
'<div> <script type="text/javascript">'
313313
"window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n "
314-
'<script src="' + plotly_cdn_url() + '"></script> '
314+
'<script charset="utf-8" src="' + plotly_cdn_url() + '"></script> '
315315
'<div id="cd462b94-79ce-42a2-887f-2650a761a144" class="plotly-graph-div" '
316316
'style="height:100%; width:100%;"></div> <script type="text/javascript">'
317317
" window.PLOTLYENV=window.PLOTLYENV || {};"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.