You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. First item.
1. ```
Some code.
More code.
```
There is code here.
1. Third item.
The code above resets item numbering for the third item. In other words, it ends one <ol> and starts another after the second item, the one starting in the code block. I could reproduce this with hoedown --fenced-code using current HEAD, namely 980b9c5.
https://spec.commonmark.org/0.29/#lists states that a list consists of consecutive list items of the same kind, so I believe that my expected behavior of one continued list is in line with the spec, and the implemented behavior is not. Things might be different if the There is code here line were considered to be after the list, but as it is still inside the <li> then the list item definitely gets treated as continuing till that line.
Some experiments show that having a non-code line of text at the beginning of the item fixes the renumbering issue. An empty line as the first item of the numbered list does fix this as well, but as the space after the number is part of the list marker, that means a trailing space in the line with the number. I have written down these cases and the resulting Hoedown rendering in a gist.
I'm actually experiencing this with Hoextdown, and will write a corresponding bug report there as well. Not sure how much exchange there is between these projects today.
The text was updated successfully, but these errors were encountered:
Prior to this change, the in_fenced flag was not set correctly for the first
line, and therefore inverted for every following line if the first line did
start with a code block. Since the start of a subsequent list item is
explicitly not detected while in fenced code, this essentially disabled the
has_next_oli detection, leading to HOEDOWN_LI_END terminating not only the
list item but the list as a whole.
Fixeshoedown#236.
The code above resets item numbering for the third item. In other words, it ends one
<ol>
and starts another after the second item, the one starting in the code block. I could reproduce this withhoedown --fenced-code
using current HEAD, namely 980b9c5.https://spec.commonmark.org/0.29/#lists states that a list consists of consecutive list items of the same kind, so I believe that my expected behavior of one continued list is in line with the spec, and the implemented behavior is not. Things might be different if the
There is code here
line were considered to be after the list, but as it is still inside the<li>
then the list item definitely gets treated as continuing till that line.Some experiments show that having a non-code line of text at the beginning of the item fixes the renumbering issue. An empty line as the first item of the numbered list does fix this as well, but as the space after the number is part of the list marker, that means a trailing space in the line with the number. I have written down these cases and the resulting Hoedown rendering in a gist.
I'm actually experiencing this with Hoextdown, and will write a corresponding bug report there as well. Not sure how much exchange there is between these projects today.
The text was updated successfully, but these errors were encountered: