mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-26 01:15:53 +00:00
HTML reader: Treat processing instructions & declarations as block.
Previously these were treated as inline, and included in paragraph tags in HTML or DocBook output, which is generally not what is wanted. Closes #1233.
This commit is contained in:
@@ -610,15 +610,19 @@ blockTags :: [String]
|
||||
blockTags = blockHtmlTags ++ blockDocBookTags
|
||||
|
||||
isInlineTag :: Tag String -> Bool
|
||||
isInlineTag t = tagOpen (`notElem` blockTags) (const True) t ||
|
||||
tagClose (`notElem` blockTags) t ||
|
||||
isInlineTag t = tagOpen isInlineTagName (const True) t ||
|
||||
tagClose isInlineTagName t ||
|
||||
tagComment (const True) t
|
||||
where isInlineTagName x = x `notElem` blockTags
|
||||
|
||||
isBlockTag :: Tag String -> Bool
|
||||
isBlockTag t = tagOpen (`elem` blocktags) (const True) t ||
|
||||
tagClose (`elem` blocktags) t ||
|
||||
isBlockTag t = tagOpen isBlockTagName (const True) t ||
|
||||
tagClose isBlockTagName t ||
|
||||
tagComment (const True) t
|
||||
where blocktags = blockTags ++ eitherBlockOrInline
|
||||
where isBlockTagName ('?':_) = True
|
||||
isBlockTagName ('!':_) = True
|
||||
isBlockTagName x = x `elem` blockTags
|
||||
|| x `elem` eitherBlockOrInline
|
||||
|
||||
isTextTag :: Tag String -> Bool
|
||||
isTextTag = tagText (const True)
|
||||
|
||||
Reference in New Issue
Block a user