aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2019-05-25 17:54:31 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2019-05-25 17:54:31 +0300
commit19f9eed0bb378dfd488265ef6946492113027cea (patch)
treef9fd588651596b88ddc2e50fa56aeed5a8a353bf /src/Text/Pandoc/Writers
parent20144a205e3434c045f8ed77f8d99a6f7bd61d02 (diff)
downloadpandoc-19f9eed0bb378dfd488265ef6946492113027cea.tar.gz
Muse writer: do not escape empty line after <br>
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Muse.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs
index ae23a4f9b..c71708e23 100644
--- a/src/Text/Pandoc/Writers/Muse.hs
+++ b/src/Text/Pandoc/Writers/Muse.hs
@@ -510,9 +510,7 @@ inlineListStartsWithAlnum _ = return False
renderInlineList :: PandocMonad m
=> [Inline]
-> Muse m Doc
-renderInlineList [] = do
- start <- asks envInlineStart
- pure $ if start then "<verbatim></verbatim>" else ""
+renderInlineList [] = pure ""
renderInlineList (x:xs) = do
start <- asks envInlineStart
afterSpace <- asks envAfterSpace
@@ -545,8 +543,11 @@ inlineListToMuse :: PandocMonad m
inlineListToMuse lst = do
lst' <- normalizeInlineList . fixNotes <$> preprocessInlineList (map (removeKeyValues . replaceSmallCaps) lst)
insideAsterisks <- asks envInsideAsterisks
+ start <- asks envInlineStart
modify $ \st -> st { stUseTags = False } -- Previous character is likely a '>' or some other markup
- local (\env -> env { envNearAsterisks = insideAsterisks }) $ renderInlineList lst'
+ if start && null lst'
+ then pure "<verbatim></verbatim>"
+ else local (\env -> env { envNearAsterisks = insideAsterisks }) $ renderInlineList lst'
inlineListToMuse' :: PandocMonad m => [Inline] -> Muse m Doc
inlineListToMuse' lst = do