aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/Org.hs4
-rw-r--r--test/command/5178.md12
-rw-r--r--test/writer.org40
3 files changed, 27 insertions, 29 deletions
diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs
index 07c2a1eda..322174cff 100644
--- a/src/Text/Pandoc/Writers/Org.hs
+++ b/src/Text/Pandoc/Writers/Org.hs
@@ -169,8 +169,6 @@ blockToOrg (Header level attr inlines) = do
else cr <> nest (level + 1) (propertiesDrawer attr)
return $ headerStr <> " " <> contents <> drawerStr <> blankline
blockToOrg (CodeBlock (_,classes,kvs) str) = do
- opts <- gets stOptions
- let tabstop = writerTabStop opts
let startnum = maybe "" (\x -> ' ' : trimr x) $ lookup "startFrom" kvs
let numberlines = if "numberLines" `elem` classes
then if "continuedSourceBlock" `elem` classes
@@ -181,7 +179,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 $ text beg $$ nest tabstop (text str) $$ text end $$ blankline
+ return $ text beg $$ nest 2 (text 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 9df3f6cf8..57aace945 100644
--- a/test/command/5178.md
+++ b/test/command/5178.md
@@ -7,19 +7,19 @@
unsafePerformIO main
^D
#+BEGIN_SRC haskell -n 42
- main = putStrLn "Hello World!"
- unsafePerformIO main
+ main = putStrLn "Hello World!"
+ unsafePerformIO main
#+END_SRC
```
```
% pandoc -f org -t native
#+BEGIN_SRC lisp -n 20
- (+ 1 1)
+ (+ 1 1)
#+END_SRC
#+BEGIN_SRC lisp +n 10
- (+ 2 2)
+ (+ 2 2)
#+END_SRC
^D
[CodeBlock ("",["commonlisp","numberLines"],[("org-language","lisp"),("startFrom","20")]) "(+ 1 1)\n"
@@ -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 cd2be4574..eb15bc5fa 100644
--- a/test/writer.org
+++ b/test/writer.org
@@ -92,9 +92,9 @@ E-mail style:
Code in a block quote:
#+BEGIN_EXAMPLE
- sub status {
- print "working";
- }
+ sub status {
+ print "working";
+ }
#+END_EXAMPLE
A list:
@@ -127,21 +127,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
--------------
@@ -364,7 +364,7 @@ Multiple blocks with italics:
- /orange/ :: orange fruit
#+BEGIN_EXAMPLE
- { orange code block }
+ { orange code block }
#+END_EXAMPLE
#+BEGIN_QUOTE
@@ -463,15 +463,15 @@ foo
This should be a code block, though:
#+BEGIN_EXAMPLE
- <div>
- foo
- </div>
+ <div>
+ foo
+ </div>
#+END_EXAMPLE
As should this:
#+BEGIN_EXAMPLE
- <div>foo</div>
+ <div>foo</div>
#+END_EXAMPLE
Now, nested:
@@ -502,7 +502,7 @@ Multiline:
Code block:
#+BEGIN_EXAMPLE
- <!-- Comment -->
+ <!-- Comment -->
#+END_EXAMPLE
Just plain comment, with trailing spaces on the line:
@@ -514,7 +514,7 @@ Just plain comment, with trailing spaces on the line:
Code:
#+BEGIN_EXAMPLE
- <hr />
+ <hr />
#+END_EXAMPLE
Hr's:
@@ -751,7 +751,7 @@ Indented [[/url][thrice]].
This should [not][] be a link.
#+BEGIN_EXAMPLE
- [not]: /url
+ [not]: /url
#+END_EXAMPLE
Foo [[/url/][bar]].
@@ -792,7 +792,7 @@ An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]
Auto-links should not occur here: =<http://example.com/>=
#+BEGIN_EXAMPLE
- or here: <http://example.com/>
+ or here: <http://example.com/>
#+END_EXAMPLE
--------------
@@ -837,7 +837,7 @@ This paragraph should not be part of the note, as it is not indented.
(as with list items).
#+BEGIN_EXAMPLE
- { <code> }
+ { <code> }
#+END_EXAMPLE
If you want, you can indent every line, but you can also be lazy and