aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-09-01 17:44:17 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-09-02 01:04:14 +0300
commitbd2bd9aeaab8a49372ba73d884a29f9ad1c8e9b7 (patch)
tree8e617c3273963472034d203e17d3f06ec26b1e1a /src/Text/Pandoc
parent23ed97f081d2a5f1ba1d9525e74dfcfbdcfe6a20 (diff)
downloadpandoc-bd2bd9aeaab8a49372ba73d884a29f9ad1c8e9b7.tar.gz
Muse writer: escape empty strings
This guarantees that conditionalEscapeString never returns empty string.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/Muse.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs
index beb289d02..cedd376e8 100644
--- a/src/Text/Pandoc/Writers/Muse.hs
+++ b/src/Text/Pandoc/Writers/Muse.hs
@@ -327,7 +327,8 @@ shouldEscapeString :: PandocMonad m
-> Muse m Bool
shouldEscapeString s = do
insideLink <- asks envInsideLinkDescription
- return $ any (`elem` ("#*<=|" :: String)) s ||
+ return $ null s ||
+ any (`elem` ("#*<=|" :: String)) s ||
"::" `isInfixOf` s ||
"~~" `isInfixOf` s ||
"[[" `isInfixOf` s ||