From bd2bd9aeaab8a49372ba73d884a29f9ad1c8e9b7 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Sat, 1 Sep 2018 17:44:17 +0300 Subject: Muse writer: escape empty strings This guarantees that conditionalEscapeString never returns empty string. --- src/Text/Pandoc/Writers/Muse.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 || -- cgit v1.2.3