diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2018-09-01 17:44:17 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2018-09-02 01:04:14 +0300 |
commit | bd2bd9aeaab8a49372ba73d884a29f9ad1c8e9b7 (patch) | |
tree | 8e617c3273963472034d203e17d3f06ec26b1e1a | |
parent | 23ed97f081d2a5f1ba1d9525e74dfcfbdcfe6a20 (diff) | |
download | pandoc-bd2bd9aeaab8a49372ba73d884a29f9ad1c8e9b7.tar.gz |
Muse writer: escape empty strings
This guarantees that conditionalEscapeString never returns empty string.
-rw-r--r-- | src/Text/Pandoc/Writers/Muse.hs | 3 |
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 || |