diff options
| author | John MacFarlane <[email protected]> | 2025-12-05 10:47:32 +0100 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2025-12-05 10:47:32 +0100 |
| commit | 6531f245403199faa6edbfddf5ec7ba83d03f958 (patch) | |
| tree | c21a4f50ab02f728b6a0ae2c1e432a98624cb272 | |
| parent | 41b14dc891b188e9daeeb322dab80e5fb4be0cd3 (diff) | |
Revert "HTML reader: ignore style tags in the body."
This reverts commit 7fe8c928212197354196724e9b95b71a854fdca9.
See #10643 and #11246.
| -rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index ab006547c..36d622abb 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -242,7 +242,7 @@ block = ((do "main" -> pDiv "figure" -> pFigure "iframe" -> pIframe - "style" -> mempty <$ pHtmlBlock "style" -- see #10643 + "style" -> pRawHtmlBlock "textarea" -> pRawHtmlBlock "switch" | epubExts @@ -538,7 +538,7 @@ pIframe = try $ do pRawHtmlBlock :: PandocMonad m => TagParser m Blocks pRawHtmlBlock = do - raw <- pHtmlBlock "script" <|> pHtmlBlock "textarea" + raw <- pHtmlBlock "script" <|> pHtmlBlock "style" <|> pHtmlBlock "textarea" <|> pRawTag exts <- getOption readerExtensions if extensionEnabled Ext_raw_html exts && not (T.null raw) @@ -713,7 +713,6 @@ inline = pTagText <|> do "input" | lookup "type" attr == Just "checkbox" -> asks inListItem >>= guard >> pCheckbox - "style" -> mempty <$ pHtmlBlock "style" -- see #10643 "script" | Just x <- lookup "type" attr , "math/tex" `T.isPrefixOf` x -> pScriptMath @@ -1078,8 +1077,6 @@ isInlineTag :: Tag Text -> Bool isInlineTag t = isCommentTag t || case t of TagOpen "script" _ -> "math/tex" `T.isPrefixOf` fromAttrib "type" t TagClose "script" -> True - TagOpen "style" _ -> True -- see #10643, invalid but it happens - TagClose "style" -> True TagOpen name _ -> isInlineTagName name TagClose name -> isInlineTagName name _ -> False |
