git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: allow table caption to contain "+"
5f7799aAlexander Krotov
src/Text/Pandoc/Readers/Muse.hs+1−1
@@ -749,7 +749,7 @@ tableParseCaption :: PandocMonad m => MuseParser m (F MuseTableElement)
749tableParseCaption = try $ fmap MuseCaption . trimInlinesF . mconcat
749tableParseCaption = try $ fmap MuseCaption . trimInlinesF . mconcat
750 <$ many spaceChar
750 <$ many spaceChar
751 <* string "|+"
751 <* string "|+"
752− <*> many1Till inline (string "+|")
752+ <*> many1Till inline (try $ string "+|")
753
753
754-- ** Inline parsers
754-- ** Inline parsers
755
755
test/Tests/Readers/Muse.hs+8
@@ -857,6 +857,14 @@ tests =
857 [plain "Foo", plain "bar", plain "baz"]
857 [plain "Foo", plain "bar", plain "baz"]
858 [[plain "First", plain "row", plain "here"],
858 [[plain "First", plain "row", plain "here"],
859 [plain "Second", plain "row", plain "there"]]
859 [plain "Second", plain "row", plain "there"]]
860+ , "Table caption with +" =:
861+ T.unlines
862+ [ "Foo | bar"
863+ , "|+ Table + caption +|"
864+ ] =?>
865+ table (text "Table + caption") (replicate 2 (AlignDefault, 0.0))
866+ []
867+ [[plain "Foo", plain "bar"]]
860 , "Caption without table" =:
868 , "Caption without table" =:
861 "|+ Foo bar baz +|" =?>
869 "|+ Foo bar baz +|" =?>
862 table (text "Foo bar baz") [] [] []
870 table (text "Foo bar baz") [] [] []