Skip to content

Commit

Permalink
Merge pull request #524 from Crozzers/fix-issue-523
Browse files Browse the repository at this point in the history
Fix angles being escaped in style blocks (issue #523)
  • Loading branch information
nicholasserra committed Aug 14, 2023
2 parents 9272f9a + 35bdcd4 commit c94e417
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/markdown2.py
Expand Up @@ -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"""
Expand Down
13 changes: 13 additions & 0 deletions test/tm-cases/script-and-style-blocks.html
@@ -0,0 +1,13 @@
<script>
if (1 > 2) {
console.log('<p>abcdef</p>');
}
</script>

<style>
pre > code {
font-family: 'Comic Sans MS';
}
</style>

<p>Some other text</p>
13 changes: 13 additions & 0 deletions test/tm-cases/script-and-style-blocks.text
@@ -0,0 +1,13 @@
<script>
if (1 > 2) {
console.log('<p>abcdef</p>');
}
</script>

<style>
pre > code {
font-family: 'Comic Sans MS';
}
</style>

Some other text

0 comments on commit c94e417

Please sign in to comment.