aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/RST.hs7
-rw-r--r--test/command/7436.md2
2 files changed, 3 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index 3990f0cb5..ff891d3c6 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -466,14 +466,11 @@ includeDirective top fields body = do
let classes = maybe [] T.words (lookup "class" fields)
let ident = maybe "" trimr $ lookup "name" fields
let parser =
- case lookup "code" fields of
+ case lookup "code" fields `mplus` lookup "literal" fields of
Just lang ->
(codeblock ident classes fields (trimr lang) False
. sourcesToText) <$> getInput
- Nothing ->
- case lookup "literal" fields of
- Just _ -> B.rawBlock "rst" . sourcesToText <$> getInput
- Nothing -> parseBlocks
+ Nothing -> parseBlocks
let isLiteral = isJust (lookup "code" fields `mplus` lookup "literal" fields)
let selectLines =
(case trim <$> lookup "end-before" fields of
diff --git a/test/command/7436.md b/test/command/7436.md
index ad4cb8c2f..fd6e51aa8 100644
--- a/test/command/7436.md
+++ b/test/command/7436.md
@@ -9,6 +9,6 @@
.. include:: command/three.txt
^D
[CodeBlock ("",[""],[("code","")]) "1st line.\n2nd line.\n3rd line.\n"
-,RawBlock (Format "rst") "1st line.\n2nd line.\n3rd line.\n"
+,CodeBlock ("",[""],[("literal","")]) "1st line.\n2nd line.\n3rd line.\n"
,Para [Str "1st",Space,Str "line.",SoftBreak,Str "2nd",Space,Str "line.",SoftBreak,Str "3rd",Space,Str "line."]]
```