Org writer: stop indenting property drawers, quote blocks

This follows the current default org-mode behavior.

Closes: 
This commit is contained in:
Albert Krewinkel 2022-03-11 12:06:24 +01:00
parent a7d94dba43
commit 168529f0a4
No known key found for this signature in database
GPG key ID: 388DC0B21F631124
2 changed files with 122 additions and 115 deletions
src/Text/Pandoc/Writers
test

View file

@ -146,7 +146,7 @@ blockToOrg (Header level attr inlines) = do
let headerStr = text $ if level > 999 then " " else replicate level '*'
let drawerStr = if attr == nullAttr
then empty
else cr <> nest (level + 1) (propertiesDrawer attr)
else cr <> propertiesDrawer attr
return $ headerStr <> " " <> contents <> drawerStr <> cr
blockToOrg (CodeBlock (_,classes,kvs) str) = do
let startnum = maybe "" (\x -> " " <> trimr x) $ lookup "startFrom" kvs
@ -163,7 +163,7 @@ blockToOrg (CodeBlock (_,classes,kvs) str) = do
blockToOrg (BlockQuote blocks) = do
contents <- blockListToOrg blocks
return $ blankline $$ "#+begin_quote" $$
nest 2 contents $$ "#+end_quote" $$ blankline
contents $$ "#+end_quote" $$ blankline
blockToOrg (Table _ blkCapt specs thead tbody tfoot) = do
let (caption', _, _, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot
caption'' <- inlineListToOrg caption'

View file

@ -75,6 +75,7 @@ E-mail style:
#+begin_quote
This is a block quote. It is pretty short.
#+end_quote
#+begin_quote
@ -95,11 +96,14 @@ E-mail style:
#+begin_quote
nested
#+end_quote
#+begin_quote
nested
#+end_quote
#+end_quote
This should not be a block quote: 2 > 1.
@ -341,6 +345,7 @@ Multiple blocks with italics:
#+begin_quote
orange block quote
#+end_quote
Multiple definitions, tight:
@ -748,6 +753,7 @@ An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]
#+begin_quote
Blockquoted: [[http://example.com/]]
#+end_quote
Auto-links should not occur here: =<http://example.com/>=
@ -781,6 +787,7 @@ note.[fn:3]
#+begin_quote
Notes can go in quotes.[fn:4]
#+end_quote
1. And in list items.[fn:5]