git.iko.soy/typeable/pandoc
on master help sign in
Commonmark reader: parse HTML as plain text if `-raw_html`.
commit6dd21250288b51f10056b15a83130f76c788d904 authorJohn MacFarlane <jgm@berkeley.edu> dateFri 2 Mar 2018, 19:30 (9 years ago) parenta71a1fe
2 files changed+10−2
changelog+8 src/Text/Pandoc/Readers/CommonMark.hs+2−2
changelog+8
@@ -7,6 +7,14 @@ pandoc (2.1.2)
77 interfered with list parsing, so now we require the fences to be flush with
88 the margin of the containing block.
99
10+ * Commonmark reader:
11+
12+ + `raw_html` is now on by default. It can be disabled explicitly
13+ using `-f commonmark-raw_html`.
14+ + When `raw_html` is disabled, HTML is parsed as regular text,
15+ rather than disappearing altogether. This matches the behavior
16+ of `markdown`.
17+
1018 * Org reader (Albert Krewinkel):
1119
1220 + Move citation tests to separate module.
src/Text/Pandoc/Readers/CommonMark.hs+2−2
@@ -109,7 +109,7 @@ addBlock opts (Node _ BLOCK_QUOTE nodes) =
109109 (BlockQuote (addBlocks opts nodes) :)
110110addBlock opts (Node _ (HTML_BLOCK t) _)
111111 | isEnabled Ext_raw_html opts = (RawBlock (Format "html") (unpack t) :)
112− | otherwise = id
112+ | otherwise = (Para [Str (unpack t)] :)
113113-- Note: the cmark parser will never generate CUSTOM_BLOCK,
114114-- so we don't need to handle it:
115115addBlock _ (Node _ (CUSTOM_BLOCK _onEnter _onExit) _nodes) =
@@ -215,7 +215,7 @@ addInline opts (Node _ SOFTBREAK _)
215215 | otherwise = (SoftBreak :)
216216addInline opts (Node _ (HTML_INLINE t) _)
217217 | isEnabled Ext_raw_html opts = (RawInline (Format "html") (unpack t) :)
218− | otherwise = id
218+ | otherwise = (Str (unpack t) :)
219219-- Note: the cmark parser will never generate CUSTOM_BLOCK,
220220-- so we don't need to handle it:
221221addInline _ (Node _ (CUSTOM_INLINE _onEnter _onExit) _nodes) =