aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2017-11-19 01:23:46 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2017-11-19 02:37:52 +0300
commit163af3fdee3c09234436ea7aab84a8b29ec1cece (patch)
tree21515fd521fee88711da59c7ff7c802e72698c99 /src/Text/Pandoc
parentb9cdef03f071b5ced19d094601a2e8cbd16748d6 (diff)
downloadpandoc-163af3fdee3c09234436ea7aab84a8b29ec1cece.tar.gz
Muse reader: produce SoftBreaks on newlines
Now wrapping can be preserved with --wrap=preserve
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs46
1 files changed, 28 insertions, 18 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 8c785e002..4510e08ce 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -556,25 +556,35 @@ tableParseCaption = try $ do
-- inline parsers
--
+inlineList :: PandocMonad m => [MuseParser m (F Inlines)]
+inlineList = [ endline
+ , br
+ , anchor
+ , footnote
+ , strong
+ , strongTag
+ , emph
+ , emphTag
+ , superscriptTag
+ , subscriptTag
+ , strikeoutTag
+ , verbatimTag
+ , link
+ , code
+ , codeTag
+ , whitespace
+ , str
+ , symbol
+ ]
+
inline :: PandocMonad m => MuseParser m (F Inlines)
-inline = choice [ br
- , anchor
- , footnote
- , strong
- , strongTag
- , emph
- , emphTag
- , superscriptTag
- , subscriptTag
- , strikeoutTag
- , verbatimTag
- , link
- , code
- , codeTag
- , whitespace
- , str
- , symbol
- ] <?> "inline"
+inline = (choice inlineList) <?> "inline"
+
+endline :: PandocMonad m => MuseParser m (F Inlines)
+endline = try $ do
+ newline
+ notFollowedBy blankline
+ returnF B.softbreak
anchor :: PandocMonad m => MuseParser m (F Inlines)
anchor = try $ do