aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/CommonMark.hs2
-rw-r--r--test/command/4527.md21
2 files changed, 22 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/CommonMark.hs b/src/Text/Pandoc/Writers/CommonMark.hs
index 50224a715..98c1101fa 100644
--- a/src/Text/Pandoc/Writers/CommonMark.hs
+++ b/src/Text/Pandoc/Writers/CommonMark.hs
@@ -116,7 +116,7 @@ blockToNodes _ (CodeBlock (_,classes,_) xs) ns = return
blockToNodes opts (RawBlock fmt xs) ns
| fmt == Format "html" && isEnabled Ext_raw_html opts
= return (node (HTML_BLOCK (T.pack xs)) [] : ns)
- | fmt == Format "latex" || fmt == Format "tex" && isEnabled Ext_raw_tex opts
+ | (fmt == Format "latex" || fmt == Format "tex") && isEnabled Ext_raw_tex opts
= return (node (CUSTOM_BLOCK (T.pack xs) T.empty) [] : ns)
| otherwise = return ns
blockToNodes opts (BlockQuote bs) ns = do
diff --git a/test/command/4527.md b/test/command/4527.md
new file mode 100644
index 000000000..984333559
--- /dev/null
+++ b/test/command/4527.md
@@ -0,0 +1,21 @@
+# Raw TeX blocks in CommonMark with and without raw_tex
+
+```
+% pandoc -f latex -t commonmark-raw_tex
+\someunknowncommand
+
+Hello.
+^D
+Hello.
+```
+
+```
+% pandoc -f latex -t commonmark+raw_tex
+\someunknowncommand
+
+Hello.
+^D
+\someunknowncommand
+
+Hello.
+```