diff --git a/CHANGES.md b/CHANGES.md index 7049ab49..a47d7ebb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ - [pull #570] Fix syntax warnings in test suite - [pull #572] Process inline tags as HTML blocks when they span multiple lines (#571) - [pull #573] Add new LaTeX Extra +- [pull #576] Fix `html`, `head` and `body` tags being wrapped in `
` tags (#575) ## python-markdown2 2.4.13 diff --git a/lib/markdown2.py b/lib/markdown2.py index 42a1518c..86876ab5 100755 --- a/lib/markdown2.py +++ b/lib/markdown2.py @@ -814,7 +814,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|style' + _block_tags_a = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del|style|html|head|body' _block_tags_a += _html5tags _strict_tag_block_re = re.compile(r""" @@ -2773,7 +2773,7 @@ class Latex(Extra): _single_dollar_re = re.compile(r'(?(.*?)", re.DOTALL) # Wraped in
_triple_re = re.compile(r'```(.*?)```', re.DOTALL) # Wrapped in a code block ``` diff --git a/test/tm-cases/block_tags.html b/test/tm-cases/block_tags.html new file mode 100644 index 00000000..12ced98a --- /dev/null +++ b/test/tm-cases/block_tags.html @@ -0,0 +1,23 @@ + + + + + + + + +content here + + + +Now some bullets: + + * one + * two + + + + + diff --git a/test/tm-cases/block_tags.text b/test/tm-cases/block_tags.text new file mode 100644 index 00000000..12ced98a --- /dev/null +++ b/test/tm-cases/block_tags.text @@ -0,0 +1,23 @@ + + + + + + + + +content here + + + +Now some bullets: + + * one + * two + + + + +