RST writer: don't treat 'example' as a syntax name.

This fixes conversions from org with example blocks.
Closes #4748.
This commit is contained in:
John MacFarlane 2018-06-30 11:45:49 +02:00
parent ce83a128e1
commit 016e0a09e2
2 changed files with 18 additions and 1 deletions

View file

@ -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

16
test/command/4748.md Normal file
View file

@ -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.
```