From 07d847a9100924e3c9bec1e536e2ad2b4b57162e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 20 Aug 2021 09:54:42 -0700 Subject: RST reader: Fix `:literal:` includes. These should create code blocks, not insert raw RST. Closes #7513. --- src/Text/Pandoc/Readers/RST.hs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/Text/Pandoc') 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 -- cgit v1.2.3