git.iko.soy/typeable/pandoc
on master help sign in
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.

commit8699071ec2d01dbf2c72eb6cda7794de8b850999 authorJohn MacFarlane <jgm@berkeley.edu> dateFri 11 Apr 2014, 10:10 (13 years ago) parent2304e9c
1 file changed+9−5
src/Text/Pandoc/Readers/HTML.hs+9−5
src/Text/Pandoc/Readers/HTML.hs+9−5
@@ -610,15 +610,19 @@ blockTags :: [String]
610610blockTags = blockHtmlTags ++ blockDocBookTags
611611
612612isInlineTag :: Tag String -> Bool
613−isInlineTag t = tagOpen (`notElem` blockTags) (const True) t ||
614− tagClose (`notElem` blockTags) t ||
613+isInlineTag t = tagOpen isInlineTagName (const True) t ||
614+ tagClose isInlineTagName t ||
615615 tagComment (const True) t
616+ where isInlineTagName x = x `notElem` blockTags
616617
617618isBlockTag :: Tag String -> Bool
618−isBlockTag t = tagOpen (`elem` blocktags) (const True) t ||
619− tagClose (`elem` blocktags) t ||
619+isBlockTag t = tagOpen isBlockTagName (const True) t ||
620+ tagClose isBlockTagName t ||
620621 tagComment (const True) t
621− where blocktags = blockTags ++ eitherBlockOrInline
622+ where isBlockTagName ('?':_) = True
623+ isBlockTagName ('!':_) = True
624+ isBlockTagName x = x `elem` blockTags
625+ || x `elem` eitherBlockOrInline
622626
623627isTextTag :: Tag String -> Bool
624628isTextTag = tagText (const True)