diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-03-02 19:30:42 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-03-02 19:30:42 -0800 |
commit | 6dd21250288b51f10056b15a83130f76c788d904 (patch) | |
tree | 7d4267950fba52cb6756202b4ff48b93c094196a /src/Text/Pandoc | |
parent | a71a1fec69104f35b3722e423a741dc68076f3db (diff) | |
download | pandoc-6dd21250288b51f10056b15a83130f76c788d904.tar.gz |
Commonmark reader: parse HTML as plain text if `-raw_html`.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/CommonMark.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/CommonMark.hs b/src/Text/Pandoc/Readers/CommonMark.hs index 6fbc09c17..e5b8775c1 100644 --- a/src/Text/Pandoc/Readers/CommonMark.hs +++ b/src/Text/Pandoc/Readers/CommonMark.hs @@ -109,7 +109,7 @@ addBlock opts (Node _ BLOCK_QUOTE nodes) = (BlockQuote (addBlocks opts nodes) :) addBlock opts (Node _ (HTML_BLOCK t) _) | isEnabled Ext_raw_html opts = (RawBlock (Format "html") (unpack t) :) - | otherwise = id + | otherwise = (Para [Str (unpack t)] :) -- Note: the cmark parser will never generate CUSTOM_BLOCK, -- so we don't need to handle it: addBlock _ (Node _ (CUSTOM_BLOCK _onEnter _onExit) _nodes) = @@ -215,7 +215,7 @@ addInline opts (Node _ SOFTBREAK _) | otherwise = (SoftBreak :) addInline opts (Node _ (HTML_INLINE t) _) | isEnabled Ext_raw_html opts = (RawInline (Format "html") (unpack t) :) - | otherwise = id + | otherwise = (Str (unpack t) :) -- Note: the cmark parser will never generate CUSTOM_BLOCK, -- so we don't need to handle it: addInline _ (Node _ (CUSTOM_INLINE _onEnter _onExit) _nodes) = |