aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2017-08-04 01:41:45 +0300
committerJohn MacFarlane <jgm@berkeley.edu>2017-08-03 15:41:45 -0700
commit7a3a8790de175c9a21d13786214fdea4bb157b3d (patch)
tree9c73a8aad3152db3ec8232934cd56e383d0c7d92
parent38b6adaac09d63501d2febb034dcd776b6de1654 (diff)
downloadpandoc-7a3a8790de175c9a21d13786214fdea4bb157b3d.tar.gz
Muse reader: do not allow headers in blockquotes (#3831)
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs2
-rw-r--r--test/Tests/Readers/Muse.hs8
2 files changed, 8 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 537596216..ca40cebe3 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -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
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
index a069bb972..6e04fd943 100644
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -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" =: