diff options
| author | Alexander Krotov <ilabdsf@gmail.com> | 2018-03-26 12:21:02 +0300 |
|---|---|---|
| committer | Alexander Krotov <ilabdsf@gmail.com> | 2018-03-26 16:05:02 +0300 |
| commit | 6d3509053884b65c57dc5dadade80316d07a44d8 (patch) | |
| tree | 05d250f7e5c15743a8f5429fb5806a8cbb682405 /src/Text/Pandoc/Writers | |
| parent | 989a9ebec3e813f6f1663ca0b5d064acc3335a4a (diff) | |
| download | pandoc-6d3509053884b65c57dc5dadade80316d07a44d8.tar.gz | |
Cleanup Muse reader and writer
Diffstat (limited to 'src/Text/Pandoc/Writers')
| -rw-r--r-- | src/Text/Pandoc/Writers/Muse.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs index af71405f3..c4614113c 100644 --- a/src/Text/Pandoc/Writers/Muse.hs +++ b/src/Text/Pandoc/Writers/Muse.hs @@ -286,7 +286,7 @@ startsWithMarker f (' ':xs) = startsWithMarker f xs startsWithMarker f (x:xs) = f x && (startsWithMarker f xs || startsWithDot xs) where - startsWithDot ('.':[]) = True + startsWithDot ['.'] = True startsWithDot ('.':c:_) = isSpace c startsWithDot _ = False startsWithMarker _ [] = False @@ -369,8 +369,8 @@ fixOrEscape (Str ";") = True fixOrEscape (Str s) = startsWithMarker isDigit s || startsWithMarker isAsciiLower s || startsWithMarker isAsciiUpper s -fixOrEscape (Space) = True -fixOrEscape (SoftBreak) = True +fixOrEscape Space = True +fixOrEscape SoftBreak = True fixOrEscape _ = False -- | Convert list of Pandoc inline elements to Muse @@ -382,9 +382,9 @@ renderInlineList True [] = pure "<verbatim></verbatim>" renderInlineList False [] = pure "" renderInlineList start (x:xs) = do r <- inlineToMuse x opts <- gets stOptions - lst' <- renderInlineList (x == SoftBreak && writerWrapText opts == WrapPreserve) xs --hcat <$> mapM inlineToMuse xs + lst' <- renderInlineList (x == SoftBreak && writerWrapText opts == WrapPreserve) xs if start && fixOrEscape x - then pure ((text "<verbatim></verbatim>") <> r <> lst') + then pure (text "<verbatim></verbatim>" <> r <> lst') else pure (r <> lst') -- | Normalize and convert list of Pandoc inline elements to Muse. |
