git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: do not allow headers in blockquotes (#3831)
7a3a879Alexander Krotov
src/Text/Pandoc/Readers/Muse.hs+1−1
@@ -244,7 +244,7 @@ rightTag :: PandocMonad m => MuseParser m (F Blocks)
244rightTag = blockTag id "right"
244rightTag = blockTag id "right"
245
245
246quoteTag :: PandocMonad m => MuseParser m (F Blocks)
246quoteTag :: PandocMonad m => MuseParser m (F Blocks)
247−quoteTag = blockTag B.blockQuote "quote"
247+quoteTag = withQuoteContext InDoubleQuote $ blockTag B.blockQuote "quote"
248
248
249commentTag :: PandocMonad m => MuseParser m (F Blocks)
249commentTag :: PandocMonad m => MuseParser m (F Blocks)
250commentTag = parseHtmlContent "comment" anyChar >> return mempty
250commentTag = parseHtmlContent "comment" anyChar >> return mempty
test/Tests/Readers/Muse.hs+7−1
@@ -132,12 +132,18 @@ tests =
132 , "Subsubsection" =:
132 , "Subsubsection" =:
133 "***** Fifth level\n" =?>
133 "***** Fifth level\n" =?>
134 header 5 "Fifth level"
134 header 5 "Fifth level"
135− , "No headers below top level" =:
135+ , "No headers in footnotes" =:
136 T.unlines [ "Foo[1]"
136 T.unlines [ "Foo[1]"
137 , "[1] * Bar"
137 , "[1] * Bar"
138 ] =?>
138 ] =?>
139 para (text "Foo" <>
139 para (text "Foo" <>
140 note (para "* Bar"))
140 note (para "* Bar"))
141+ , "No headers in quotes" =:
142+ T.unlines [ "<quote>"
143+ , "* Hi"
144+ , "</quote>"
145+ ] =?>
146+ blockQuote (para "* Hi")
141 ]
147 ]
142 , testGroup "Footnotes"
148 , testGroup "Footnotes"
143 [ "Simple footnote" =:
149 [ "Simple footnote" =: