From df7a4b41d391e5e9839dffee13f124942e2198c6 Mon Sep 17 00:00:00 2001 From: Naoto Mizuno Date: Fri, 17 Mar 2023 16:57:43 +0900 Subject: [PATCH] Specify utf-8 in script tag --- packages/python/plotly/plotly/io/_html.py | 6 +++--- .../plotly/tests/test_core/test_offline/test_offline.py | 6 ++++-- .../python/plotly/plotly/tests/test_io/test_renderers.py | 4 +++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/python/plotly/plotly/io/_html.py b/packages/python/plotly/plotly/io/_html.py index ccad92ed00..50e15f5cda 100644 --- a/packages/python/plotly/plotly/io/_html.py +++ b/packages/python/plotly/plotly/io/_html.py @@ -272,7 +272,7 @@ def to_html( elif include_plotlyjs == "cdn": load_plotlyjs = """\ {win_config} - \ + \ """.format( win_config=_window_plotly_config, cdn_url=plotly_cdn_url() ) @@ -280,7 +280,7 @@ def to_html( elif include_plotlyjs == "directory": load_plotlyjs = """\ {win_config} - \ + \ """.format( win_config=_window_plotly_config ) @@ -288,7 +288,7 @@ def to_html( elif isinstance(include_plotlyjs, str) and include_plotlyjs.endswith(".js"): load_plotlyjs = """\ {win_config} - \ + \ """.format( win_config=_window_plotly_config, url=include_plotlyjs_orig ) diff --git a/packages/python/plotly/plotly/tests/test_core/test_offline/test_offline.py b/packages/python/plotly/plotly/tests/test_core/test_offline/test_offline.py index 95c0dd35b2..5d387e5e1b 100644 --- a/packages/python/plotly/plotly/tests/test_core/test_offline/test_offline.py +++ b/packages/python/plotly/plotly/tests/test_core/test_offline/test_offline.py @@ -41,9 +41,11 @@ """ -cdn_script = ''.format(cdn_url=plotly_cdn_url()) +cdn_script = ''.format( + cdn_url=plotly_cdn_url() +) -directory_script = '' +directory_script = '' mathjax_cdn = "https://cdnjs.cloudflare.com" "/ajax/libs/mathjax/2.7.5/MathJax.js" diff --git a/packages/python/plotly/plotly/tests/test_io/test_renderers.py b/packages/python/plotly/plotly/tests/test_io/test_renderers.py index bb521621c0..429c3178cc 100644 --- a/packages/python/plotly/plotly/tests/test_io/test_renderers.py +++ b/packages/python/plotly/plotly/tests/test_io/test_renderers.py @@ -311,7 +311,9 @@ def test_repr_html(renderer): template = ( '
\n " - ' ' + ' ' '