diff options
-rw-r--r-- | src/Text/Pandoc/Readers/CommonMark.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/CommonMark.hs b/src/Text/Pandoc/Readers/CommonMark.hs index 4a5081d65..14be946e6 100644 --- a/src/Text/Pandoc/Readers/CommonMark.hs +++ b/src/Text/Pandoc/Readers/CommonMark.hs @@ -54,6 +54,9 @@ readCommonMark opts s = return $ (if enabled Ext_emoji then addEmojis else id) $ + (if enabled Ext_hard_line_breaks + then walk softToHardBreaks + else id) $ nodeToPandoc $ commonmarkToNode opts' exts s where opts' = [ optSmart | enabled Ext_smart ] exts = [ extStrikethrough | enabled Ext_strikeout ] ++ @@ -61,6 +64,10 @@ readCommonMark opts s = return $ [ extAutolink | enabled Ext_autolink_bare_uris ] enabled x = extensionEnabled x (readerExtensions opts) +softToHardBreaks :: Inline -> Inline +softToHardBreaks SoftBreak = LineBreak +softToHardBreaks x = x + addEmojis :: Pandoc -> Pandoc addEmojis = walk go where go (Str xs) = Str (convertEmojis xs) |