@@ -377,10 +377,11 @@ startsWithMarker f (x:xs) =
377377 startsWithDot _ = False
378378startsWithMarker _ [] = False
379379
380−containsFootnotes :: String -> Bool
381−containsFootnotes = p
382− where p ('[':xs) = q xs || p xs
383− p (_:xs) = p xs
380+containsNotes :: Char -> Char -> String -> Bool
381+containsNotes left right = p
382+ where p (left':xs)
383+ | left' == left = q xs || p xs
384+ | otherwise = p xs
384385 p "" = False
385386 q (x:xs)
386387 | x `elem` ("123456789"::String) = r xs || p xs
@@ -388,8 +389,9 @@ containsFootnotes = p
388389 q [] = False
389390 r ('0':xs) = r xs || p xs
390391 r xs = s xs || q xs || p xs
391− s (']':_) = True
392− s (_:xs) = p xs
392+ s (right':xs)
393+ | right' == right = True
394+ | otherwise = p xs
393395 s [] = False
394396
395397-- | Return True if string should be escaped with <verbatim> tags
@@ -404,7 +406,8 @@ shouldEscapeString s = do
404406 "~~" `isInfixOf` s ||
405407 "[[" `isInfixOf` s ||
406408 ("]" `isInfixOf` s && insideLink) ||
407− containsFootnotes s
409+ containsNotes '[' ']' s ||
410+ containsNotes '{' '}' s
408411
409412-- | Escape special characters for Muse if needed.
410413conditionalEscapeString :: PandocMonad m