aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-09-09 12:11:05 -0700
committerGitHub <noreply@github.com>2017-09-09 12:11:05 -0700
commit4f2dd91e36744de32d7be03eac5d017b67ac69b7 (patch)
tree8095129fd8fa14c89a8e97b90967cd2b14b0a8a8 /src/Text/Pandoc/Readers
parent23582298765cb960507a5eaa507921a7adae6abb (diff)
parent2230371304f299ca7333af8ad0ee7bcd099a4aa0 (diff)
downloadpandoc-4f2dd91e36744de32d7be03eac5d017b67ac69b7.tar.gz
Merge pull request #3904 from labdsf/muse-reader-code
Muse reader: debug inline code markup
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 2454057fa..3b089772f 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -575,13 +575,6 @@ enclosedInlines :: (PandocMonad m, Show a, Show b)
enclosedInlines start end = try $
trimInlinesF . mconcat <$> enclosed start end inline
-verbatimBetween :: PandocMonad m
- => Char
- -> MuseParser m String
-verbatimBetween c = try $ do
- char c
- many1Till anyChar $ char c
-
inlineTag :: PandocMonad m
=> (Inlines -> Inlines)
-> String
@@ -617,9 +610,13 @@ code = try $ do
sp <- if sourceColumn pos == 1
then pure mempty
else skipMany1 spaceChar >> pure B.space
- cd <- verbatimBetween '='
+ char '='
+ contents <- many1Till (noneOf "\n\r" <|> (newline <* notFollowedBy newline)) $ char '='
+ guard $ not $ null contents
+ guard $ head contents `notElem` " \t\n"
+ guard $ last contents `notElem` " \t\n"
notFollowedBy nonspaceChar
- return $ return (sp B.<> B.code cd)
+ return $ return (sp B.<> B.code contents)
codeTag :: PandocMonad m => MuseParser m (F Inlines)
codeTag = do