From 784bad2e10e246c4a3ae22e45347fb2301506e93 Mon Sep 17 00:00:00 2001 From: Crozzers Date: Sun, 13 Aug 2023 21:38:32 +0100 Subject: [PATCH 1/2] Fix angles being escaped in style blocks --- lib/markdown2.py | 2 +- test/tm-cases/script-and-style-blocks.html | 13 +++++++++++++ test/tm-cases/script-and-style-blocks.text | 13 +++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 test/tm-cases/script-and-style-blocks.html create mode 100644 test/tm-cases/script-and-style-blocks.text diff --git a/lib/markdown2.py b/lib/markdown2.py index 686fe29e..87b9858c 100755 --- a/lib/markdown2.py +++ b/lib/markdown2.py @@ -715,7 +715,7 @@ def _detab(self, text): # _block_tags_b. This way html5 tags are easy to keep track of. _html5tags = '|article|aside|header|hgroup|footer|nav|section|figure|figcaption' - _block_tags_a = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del' + _block_tags_a = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del|style' _block_tags_a += _html5tags _strict_tag_block_re = re.compile(r""" diff --git a/test/tm-cases/script-and-style-blocks.html b/test/tm-cases/script-and-style-blocks.html new file mode 100644 index 00000000..a855b8ba --- /dev/null +++ b/test/tm-cases/script-and-style-blocks.html @@ -0,0 +1,13 @@ + + + + +

Some other text

diff --git a/test/tm-cases/script-and-style-blocks.text b/test/tm-cases/script-and-style-blocks.text new file mode 100644 index 00000000..73c508e7 --- /dev/null +++ b/test/tm-cases/script-and-style-blocks.text @@ -0,0 +1,13 @@ + + + + +Some other text From 35bdcd45a34a51ec9bbd6fc05833722fa8fba71e Mon Sep 17 00:00:00 2001 From: Crozzers Date: Sun, 13 Aug 2023 21:44:12 +0100 Subject: [PATCH 2/2] Update CHANGES.md --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index dc355cee..38983901 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,7 @@ ## python-markdown2 2.4.11 (not yet released) -(nothing yet) +- [pull #524] Fix angles being escaped in style blocks (issue #523) ## python-markdown2 2.4.10