From 03feb922b0785759b58daa0b230e9d37e9145a81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cmishrakushal=E2=80=9D?= <“misc.kushal@gmail.com”> Date: Wed, 6 Nov 2024 15:39:46 +0530 Subject: [PATCH 1/4] Added to the to_html template --- plotly/io/_html.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plotly/io/_html.py b/plotly/io/_html.py index c2153dc5b0..7c1c4e3e4e 100644 --- a/plotly/io/_html.py +++ b/plotly/io/_html.py @@ -339,6 +339,7 @@ def to_html( if full_html: return """\ +
From bb7f7395aa38926a146a4a17e1a9b4a149036db6 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Thu, 6 Aug 2026 18:11:16 -0400 Subject: [PATCH 2/4] update tests --- tests/test_core/test_offline/test_offline.py | 2 +- tests/test_io/test_renderers.py | 4 ++-- tests/test_optional/test_offline/test_offline.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_core/test_offline/test_offline.py b/tests/test_core/test_offline/test_offline.py index 791fb7c646..5bf185a7d9 100644 --- a/tests/test_core/test_offline/test_offline.py +++ b/tests/test_core/test_offline/test_offline.py @@ -108,7 +108,7 @@ def test_default_plot_generates_expected_html(self): self.assertIn(plotly_config_script, html) # so is config self.assertIn(PLOTLYJS, html) # and the source code # and it's an doc - self.assertTrue(html.startswith("") and html.endswith("")) + self.assertTrue(html.startswith("") and html.endswith("")) def test_including_plotlyjs_truthy_html(self): # For backwards compatibility all truthy values that aren't otherwise diff --git a/tests/test_io/test_renderers.py b/tests/test_io/test_renderers.py index 521b944773..b1019b8249 100644 --- a/tests/test_io/test_renderers.py +++ b/tests/test_io/test_renderers.py @@ -133,11 +133,11 @@ def test_plotly_mimetype_renderer_show(fig1, renderer): # HTML # ---- def assert_full_html(html): - assert html.startswith(" doc - self.assertTrue(html.startswith("") and html.endswith("")) + self.assertTrue(html.startswith("") and html.endswith("")) From 734520bb797f8a35ea2800b454c56147a1709d91 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Thu, 6 Aug 2026 18:15:05 -0400 Subject: [PATCH 3/4] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index adcd44308d..b3d08e1f21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Fix `hex_to_rgb` parsing of 3-digit shorthand hexadecimal colors such as `#FFF` [[#5662](https://github.com/plotly/plotly.py/pull/5662)], with thanks to @genrichez for the contribution! +- Add to the `to_html()` template to comply with modern web standards [[#5693](https://github.com/plotly/plotly.py/pull/5693)], with thanks to @mishrakushal for the contribution! ## [6.9.0] - 2026-07-09 From 3cec9902d7eb258f944ae95aea559c90669d9d1e Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Thu, 6 Aug 2026 19:59:54 -0400 Subject: [PATCH 4/4] run formatter --- tests/test_optional/test_offline/test_offline.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_optional/test_offline/test_offline.py b/tests/test_optional/test_offline/test_offline.py index 81e80457de..0f753f9884 100644 --- a/tests/test_optional/test_offline/test_offline.py +++ b/tests/test_optional/test_offline/test_offline.py @@ -88,4 +88,6 @@ def test_default_mpl_plot_generates_expected_html(self): self.assertTrue(data_json in html) # data is in there self.assertTrue(PLOTLYJS in html) # and the source code # and it's an doc - self.assertTrue(html.startswith("") and html.endswith("")) + self.assertTrue( + html.startswith("") and html.endswith("") + )