Muse reader: do not allow headers in blockquotes (#3831)

This commit is contained in:
Alexander Krotov 2017-08-04 01:41:45 +03:00 committed by John MacFarlane
parent 38b6adaac0
commit 7a3a8790de
2 changed files with 8 additions and 2 deletions

View file

@ -244,7 +244,7 @@ rightTag :: PandocMonad m => MuseParser m (F Blocks)
rightTag = blockTag id "right"
quoteTag :: PandocMonad m => MuseParser m (F Blocks)
quoteTag = blockTag B.blockQuote "quote"
quoteTag = withQuoteContext InDoubleQuote $ blockTag B.blockQuote "quote"
commentTag :: PandocMonad m => MuseParser m (F Blocks)
commentTag = parseHtmlContent "comment" anyChar >> return mempty

View file

@ -132,12 +132,18 @@ tests =
, "Subsubsection" =:
"***** Fifth level\n" =?>
header 5 "Fifth level"
, "No headers below top level" =:
, "No headers in footnotes" =:
T.unlines [ "Foo[1]"
, "[1] * Bar"
] =?>
para (text "Foo" <>
note (para "* Bar"))
, "No headers in quotes" =:
T.unlines [ "<quote>"
, "* Hi"
, "</quote>"
] =?>
blockQuote (para "* Hi")
]
, testGroup "Footnotes"
[ "Simple footnote" =: