git.iko.soy/typeable/pandoc
on master help sign in
HTML reader: Treat processing instructions & declarations as block.
8699071John MacFarlane
src/Text/Pandoc/Readers/HTML.hs+9−5
@@ -610,15 +610,19 @@ blockTags :: [String]
610blockTags = blockHtmlTags ++ blockDocBookTags
610blockTags = blockHtmlTags ++ blockDocBookTags
611
611
612isInlineTag :: Tag String -> Bool
612isInlineTag :: Tag String -> Bool
613−isInlineTag t = tagOpen (`notElem` blockTags) (const True) t ||
613+isInlineTag t = tagOpen isInlineTagName (const True) t ||
614− tagClose (`notElem` blockTags) t ||
614+ tagClose isInlineTagName t ||
615 tagComment (const True) t
615 tagComment (const True) t
616+ where isInlineTagName x = x `notElem` blockTags
616
617
617isBlockTag :: Tag String -> Bool
618isBlockTag :: Tag String -> Bool
618−isBlockTag t = tagOpen (`elem` blocktags) (const True) t ||
619+isBlockTag t = tagOpen isBlockTagName (const True) t ||
619− tagClose (`elem` blocktags) t ||
620+ tagClose isBlockTagName t ||
620 tagComment (const True) t
621 tagComment (const True) t
622+ where isBlockTagName ('?':_) = True
623+ isBlockTagName ('!':_) = True
624+ isBlockTagName x = x `elem` blockTags
621− where blocktags = blockTags ++ eitherBlockOrInline
625+ || x `elem` eitherBlockOrInline
622
626
623isTextTag :: Tag String -> Bool
627isTextTag :: Tag String -> Bool
624isTextTag = tagText (const True)
628isTextTag = tagText (const True)