diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2017-06-25 11:01:43 +0300 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-06-25 10:01:43 +0200 |
commit | f8877516e03ec678aeb735cdafe56e20ca52b235 (patch) | |
tree | a003ea57d18b783bf0c8bf85a5d71c9d9f70c7bf /src/Text/Pandoc/Readers/Muse.hs | |
parent | 743419af5c0872d8e4b5fdf53d47080e8648b4a7 (diff) | |
download | pandoc-f8877516e03ec678aeb735cdafe56e20ca52b235.tar.gz |
Muse reader: Require space before and after '=' for code (#3758)
Diffstat (limited to 'src/Text/Pandoc/Readers/Muse.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index 7eee064a7..fe8a55f5c 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -442,8 +442,7 @@ tableParseCaption = try $ do -- inline :: PandocMonad m => MuseParser m (F Inlines) -inline = choice [ whitespace - , br +inline = choice [ br , footnote , strong , strongTag @@ -455,6 +454,7 @@ inline = choice [ whitespace , link , code , codeTag + , whitespace , str , symbol ] <?> "inline" @@ -535,7 +535,14 @@ strikeoutTag :: PandocMonad m => MuseParser m (F Inlines) strikeoutTag = inlineTag B.strikeout "del" code :: PandocMonad m => MuseParser m (F Inlines) -code = return . B.code <$> verbatimBetween '=' +code = try $ do + pos <- getPosition + sp <- if sourceColumn pos == 1 + then pure mempty + else skipMany1 spaceChar >> pure B.space + cd <- verbatimBetween '=' + notFollowedBy nonspaceChar + return $ return (sp B.<> B.code cd) codeTag :: PandocMonad m => MuseParser m (F Inlines) codeTag = do |