diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-06-30 11:45:49 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-06-30 11:45:49 +0200 |
commit | 016e0a09e2e2ffa823157a28a3a7f0268b9c6f42 (patch) | |
tree | 991225dba7a1c2d9fcdb733177746ae26d29319d | |
parent | ce83a128e1ceee879069d5e0dda8402aa2cbed32 (diff) | |
download | pandoc-016e0a09e2e2ffa823157a28a3a7f0268b9c6f42.tar.gz |
RST writer: don't treat 'example' as a syntax name.
This fixes conversions from org with example blocks.
Closes #4748.
-rw-r--r-- | src/Text/Pandoc/Writers/RST.hs | 3 | ||||
-rw-r--r-- | test/command/4748.md | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index 1fd984a6d..a2f2739a0 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -273,7 +273,8 @@ blockToRST (CodeBlock (_,classes,kvs) str) = do then return $ prefixed "> " (text str) $$ blankline else return $ (case [c | c <- classes, - c `notElem` ["sourceCode","literate","numberLines"]] of + c `notElem` ["sourceCode","literate","numberLines", + "number-lines","example"]] of [] -> "::" (lang:_) -> (".. code:: " <> text lang) $$ numberlines) $+$ nest 3 (text str) $$ blankline diff --git a/test/command/4748.md b/test/command/4748.md new file mode 100644 index 000000000..1de0fa9ed --- /dev/null +++ b/test/command/4748.md @@ -0,0 +1,16 @@ +``` +% pandoc -f org -t rst +Before example block. +#+begin_example +This is in an example block. +#+end_example +After example block. +^D +Before example block. + +:: + + This is in an example block. + +After example block. +``` |