diff options
author | John MacFarlane <jgm@berkeley.edu> | 2021-08-20 09:54:42 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-08-20 09:54:42 -0700 |
commit | 07d847a9100924e3c9bec1e536e2ad2b4b57162e (patch) | |
tree | 85de263315601ffb0f768e53e6463737da549ab3 /src/Text/Pandoc | |
parent | 9879953a4f385be65c0c64d02cd281a4ad676d0d (diff) | |
download | pandoc-07d847a9100924e3c9bec1e536e2ad2b4b57162e.tar.gz |
RST reader: Fix `:literal:` includes.
These should create code blocks, not insert raw RST.
Closes #7513.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/RST.hs | 7 |
1 files changed, 2 insertions, 5 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 |