File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -901,7 +901,7 @@ def _detab(self, text: str) -> str:
901901 """ % _block_tags_a ,
902902 re .X | re .M )
903903
904- _block_tags_b = 'blockquote|div|dl|fieldset|form|h[1-6]|iframe|math|noscript|ol|p|pre|script|table|ul'
904+ _block_tags_b = 'blockquote|div|dl|fieldset|form|h[1-6]|head| iframe|math|noscript|ol|p|pre|script|style |table|ul'
905905 _block_tags_b += _html5tags
906906
907907 _span_tags = (
Original file line number Diff line number Diff line change @@ -272,6 +272,18 @@ def test_russian(self):
272272 '<h2>%s</h2>\n ' % ko )
273273 test_russian .tags = ["unicode" , "issue3" ]
274274
275+ def test_head_and_style_block_tags (self ):
276+ # `head` and `style` are block-level, but were missing from the
277+ # liberal block-tag list, so a single-line `<style>...</style>` (or
278+ # `<head>`) got wrapped in a spurious `<p>`.
279+ self ._assertMarkdown (
280+ '<style>body { margin-left: 1.25cm; }</style>' ,
281+ '<style>body { margin-left: 1.25cm; }</style>\n ' )
282+ self ._assertMarkdown (
283+ '<head><meta charset="UTF-8"></head>' ,
284+ '<head><meta charset="UTF-8"></head>\n ' )
285+ test_head_and_style_block_tags .tags = ["html" , "issue331" ]
286+
275287 def test_breaks_and_break_on_newline_together (self ):
276288 # `break-on-newline` is an alias for the breaks extra; supplying both
277289 # in the common list form used to raise TypeError during setup.
You can’t perform that action at this time.
0 commit comments