diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index 39af6717e..f4a22695c 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -154,7 +154,7 @@ blockToOrg (CodeBlock (_,classes,kvs) str) = do let (beg, end) = case at of [] -> ("#+begin_example" <> numberlines, "#+end_example") (x:_) -> ("#+begin_src " <> x <> numberlines, "#+end_src") - return $ literal beg $$ nest 2 (literal str) $$ text end $$ blankline + return $ literal beg $$ literal str $$ text end $$ blankline blockToOrg (BlockQuote blocks) = do contents <- blockListToOrg blocks return $ blankline $$ "#+begin_quote" $$ diff --git a/test/command/5178.md b/test/command/5178.md index 856f86abc..feb2c4b99 100644 --- a/test/command/5178.md +++ b/test/command/5178.md @@ -7,8 +7,8 @@ unsafePerformIO main ^D #+begin_src haskell -n 42 - main = putStrLn "Hello World!" - unsafePerformIO main +main = putStrLn "Hello World!" +unsafePerformIO main #+end_src ``` @@ -32,10 +32,10 @@ ,CodeBlock ("",["commonlisp","numberLines","continuedSourceBlock"],[("org-language","lisp"),("startFrom","10")]) "(+ 2 2)\n"] ^D #+begin_src lisp -n 20 - (+ 1 1) +(+ 1 1) #+end_src #+begin_src lisp +n 10 - (+ 2 2) +(+ 2 2) #+end_src ``` diff --git a/test/writer.org b/test/writer.org index df9d2b3a5..38ec35a3e 100644 --- a/test/writer.org +++ b/test/writer.org @@ -81,9 +81,9 @@ E-mail style: Code in a block quote: #+begin_example - sub status { - print "working"; - } + sub status { + print "working"; + } #+end_example A list: @@ -115,21 +115,21 @@ And a following paragraph. Code: #+begin_example - ---- (should be four hyphens) +---- (should be four hyphens) - sub status { - print "working"; - } +sub status { + print "working"; +} - this code block is indented by one tab +this code block is indented by one tab #+end_example And: #+begin_example - this code block is indented by two tabs + this code block is indented by two tabs - These should not be escaped: \$ \\ \> \[ \{ +These should not be escaped: \$ \\ \> \[ \{ #+end_example -------------- @@ -348,7 +348,7 @@ Multiple blocks with italics: - /orange/ :: orange fruit #+begin_example - { orange code block } + { orange code block } #+end_example #+begin_quote @@ -446,15 +446,15 @@ foo This should be a code block, though: #+begin_example -
}
+ { }
#+end_example
If you want, you can indent every line, but you can also be lazy and