Fix list item parsing and headline token lvls
As headlines are always lvl (indent) 0 I thought it would be clever to abuse the lvl field to store the headline lvl. Well, here we are - it wasn't clever. List items only end when their parent ends or they run into something that's not indented enough - everything else becomes part of the list item. Abusing the token.lvl field (indent) for the headline lvl means headlines look indented to the list item parsing logic - i.e. they become part of the list item if the headline has a high enough lvl. That should never happen - so let's get rid of the hack and (re-)calculate the headline lvl when we need it.
This commit is contained in:
parent
add727c011
commit
64b2b22270
4 changed files with 44 additions and 6 deletions
4
org/testdata/misc.org
vendored
4
org/testdata/misc.org
vendored
|
@ -140,6 +140,10 @@ When inserting an image link like [[/home/amos/Pictures/Screenshots/img-2017-09-
|
|||
*** index out of range in explicit line break parsing
|
||||
0\\
|
||||
|
||||
*** list items don't end on child headline
|
||||
- a list item
|
||||
**** followed by a child headline
|
||||
- followed by another list item
|
||||
* Footnotes
|
||||
|
||||
[fn:1] a footnote /with/ *markup*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue