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

Problem with headers lower then 3 in org-mode reader #3214

Closed
kepi opened this issue Nov 4, 2016 · 7 comments

Comments

@kepi
Copy link

commented Nov 4, 2016

Since version 1.17.2 I'm not able to export org documents correctly if there is heading level lower than 3.

* heading one
text
** heading two
text
*** heading three
text
**** heading four
text

Exporting to markdown results in:

heading one
===========

text

heading two
-----------

text

### heading three

text

1.  heading four

    text

Which is wrong. In version 1.17.1-2 it works without any problem. Similar problem is in textile output, looks like markdown is implementing header 4 and lower as numbered list instead of heading.

@jgm

This comment has been minimized.

Copy link
Owner

commented Nov 4, 2016

@tarleb

This comment has been minimized.

Copy link
Collaborator

commented Nov 4, 2016

Sound like this is the result of 1.17.2 adding support for the H export option. That option controls the level below which headlines are converted into list items. The Emacs default for this option is 3, so the org-reader, aiming for maximal compatibility, does the same. This therefor is indeed indented behavior. However, two similar questions came up on pandoc-discuss already, so I'm starting to wonder if that was an error. It seems unexpected to many people and maybe pandoc should use a different default value.

@kepi, you can avoid this conversion by adding

#+OPTIONS: H:9

somewhere near the top of your org-mode file. See the orgmode documentation for details. Of the export options listed there, pandoc v1.17.2 and up supports ^, ', *, -, arch, author, creator, d, email, and H. The current master also supports the todo option.

@kepi

This comment has been minimized.

Copy link
Author

commented Nov 5, 2016

@tarleb thanks for this workaround, I'll try that.

I can see that you are right and default exports are behaving same way. I hit the problem when I tried export to textile which is clearly broken and can't work with this. It renders html instead of textile when it find this list instead of heading. I should report it to different issue probably.

Anyway one thing is sure. It is problem because it behaved differently for long time and now there is confusion from it. It would be great to at least let users now somehow.

Thanks again for quick reply and workaround.

@jgm

This comment has been minimized.

Copy link
Owner

commented Nov 5, 2016

+++ Kepi [Nov 04 16 17:56 ]:

It renders html instead of textile
when it find this list instead of heading. I should report it to
different issue probably.

Yes. This can be closed.

Anyway one thing is sure. It is problem because it behaved differently
for long time and now there is confusion from it. It would be great to
at least let users now somehow.

Well, we do have a changelog! I note items like

* Support headline levels export setting (Albert
* Krewinkel).  The depths of headlines can be modified using the
  `H` option.  Deeper headlines will be converted to lists.
@kepi

This comment has been minimized.

Copy link
Author

commented Nov 5, 2016

I'm not against closing but I red changelog and I didn't realize this is the thing causing problem. Main problem is default behaviour changed.

@jgm

This comment has been minimized.

Copy link
Owner

commented Nov 5, 2016

Yes, granted, this could have been noted more prominently in the changelog/commit message.

@jgm jgm closed this Nov 5, 2016

@tarleb

This comment has been minimized.

Copy link
Collaborator

commented Nov 5, 2016

Duly noted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.