Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Org writer: wrong indentation of properties block #3245

Closed
ngirard opened this issue Nov 20, 2016 · 7 comments
Closed

Org writer: wrong indentation of properties block #3245

ngirard opened this issue Nov 20, 2016 · 7 comments

Comments

@ngirard
Copy link

ngirard commented Nov 20, 2016

When typing either
echo "<h2>Title</h2>" | pandoc -f html -t org
or
echo "** Title" | pandoc -f org -t org
Pandoc produces

** Title
   :PROPERTIES:
   :CUSTOM_ID: title
   :END:

The properties block shouldn't be aligned to the title but rather start at column 0:

** Title
:PROPERTIES:
:CUSTOM_ID: title
:END:

I'm using a fresh version of Pandoc built from trunk.

@tarleb
Copy link
Collaborator

tarleb commented Nov 21, 2016

What makes you think this is wrong? If you run org-set-property (C-c C-x p), the PROPERTIES block is inserted indented. Pandoc simply mimics this behavior. Any reason why we should deviate from this?

@tarleb
Copy link
Collaborator

tarleb commented Nov 24, 2016

I'm closing this for now. Feel free to reopen if there are pressing reasons to change the current behavior.

If you want to change this for your installation, you can delete nest (level + 1) from line 190 in src/Text/Pandoc/Writers/Org.hs and recompile. That will cause the properties block to be emitted unindented.

@tarleb tarleb closed this as completed Nov 24, 2016
@ivanhjc
Copy link

ivanhjc commented Jun 2, 2021

@tarleb

I'm closing this for now. Feel free to reopen if there are pressing reasons to change the current behavior.

If you want to change this for your installation, you can delete nest (level + 1) from line 190 in src/Text/Pandoc/Writers/Org.hs and recompile. That will cause the properties block to be emitted unindented.

Is this an option now? Because if the properties drawers are inserted indented and org-indent-mode is turned on, they appear unindented with the headings. For example, the following snippet

* Test
  :PROPERTIES:
  :CUSTOM_ID: ddd
  :END:

will be displayed like this when org-indent-mode is turned on:

* Test
    :PROPERTIES:
    :CUSTOM_ID: ddd
    :END:

I'm currently using pandoc 2.14.0.1 and org 9.3.

@ivanhjc
Copy link

ivanhjc commented Jun 2, 2021

I found a solution which is to run org-indent-region after conversion.

@hpfr
Copy link

hpfr commented Mar 10, 2022

What makes you think this is wrong? If you run org-set-property (C-c C-x p), the PROPERTIES block is inserted indented. Pandoc simply mimics this behavior. Any reason why we should deviate from this?

@tarleb It looks like this behavior has been fixed in Org. Nowadays drawers are not indented by org-set-property (and indeed org-indent-region now corrects Pandoc's indentation), so this issue is probably worth reopening. Could Pandoc's default behavior be changed to match Org's new default behavior?

@jgm
Copy link
Owner

jgm commented Mar 11, 2022

I agree. I just tried org-indent-region and, although the :PROPERTIES: did look indented when viewed with org-mode, it isn't actually indented (as you can see if you look at the file with less).
I'll change the writer so it doesn't insert this indentation. Well, let's get @tarleb's feedback.
I note that we also currently have a 2 space nesting for #+begin_quote -- that, too, seems superfluous, and different from what one gets by default. Should we remove that too?

@tarleb
Copy link
Collaborator

tarleb commented Mar 11, 2022

👍 staying close to the default org behavior seems best. I'll make the changes.

@tarleb tarleb reopened this Mar 11, 2022
@tarleb tarleb closed this as completed in 168529f Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants