diff options
| author | John MacFarlane <[email protected]> | 2025-12-05 11:13:02 +0100 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2025-12-05 11:14:11 +0100 |
| commit | a3ab4b8545babfb88b9ffda1cfa85de31ddc57ef (patch) | |
| tree | 4e97bc767f2ca02fcbe1aac9150a7780d4ade942 /src | |
| parent | 6531f245403199faa6edbfddf5ec7ba83d03f958 (diff) | |
HTML reader: parse inline style elements as RawInline.
This is a cleaner fix to #10643 than the reverted commit 7fe8c92.
Styles are not stripped, but with this change they will not
interfere with inline parsing.
Closes #11246.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index 36d622abb..23019e651 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -713,6 +713,7 @@ inline = pTagText <|> do "input" | lookup "type" attr == Just "checkbox" -> asks inListItem >>= guard >> pCheckbox + "style" -> B.rawInline "html" <$> pHtmlBlock "style" "script" | Just x <- lookup "type" attr , "math/tex" `T.isPrefixOf` x -> pScriptMath @@ -1077,6 +1078,8 @@ 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 |
