git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: do not produce empty Str element for unindented verse lines
commit4d2bf177fc8e41d385631c1d1abfe7943680982e authorAlexander Krotov <ilabdsf@gmail.com> dateWed 7 Mar 2018, 14:21 (9 years ago) parent54a6b75
2 files changed+4−2
src/Text/Pandoc/Readers/Muse.hs+3−2 test/Tests/Readers/Muse.hs+1
src/Text/Pandoc/Readers/Muse.hs+3−2
@@ -506,9 +506,10 @@ emacsNoteBlock = try $ do
506506lineVerseLine :: PandocMonad m => MuseParser m (F Inlines)
507507lineVerseLine = try $ do
508508 string "> "
509− indent <- B.str <$> many (char ' ' >> pure '\160')
509+ indent <- many (char ' ' >> pure '\160')
510+ let indentEl = if null indent then mempty else B.str indent
510511 rest <- manyTill (choice inlineList) eol
511− return $ trimInlinesF $ mconcat (pure indent : rest)
512+ return $ trimInlinesF $ mconcat (pure indentEl : rest)
512513
513514blanklineVerseLine :: PandocMonad m => MuseParser m (F Inlines)
514515blanklineVerseLine = try $ do
test/Tests/Readers/Muse.hs+1
@@ -296,6 +296,7 @@ tests =
296296 ]
297297 ]
298298 , "Verse in list" =: " - > foo" =?> bulletList [ lineBlock [ "foo" ] ]
299+ , "Verse line starting with emphasis" =: "> *foo* bar" =?> lineBlock [ emph "foo" <> text " bar" ]
299300 , "Multiline verse in list" =:
300301 T.unlines [ " - > foo"
301302 , " > bar"