hugo: Hugo v0.55.5 regression: Blackfriday version downgrade breaks rendering of list/code block
Hello,
I discovered this issue from this comment in the Discourse forum.
The issue is that for a Markdown snippet:
- list item 1
```md
*hello*
```
- list item 2
list item 2 now gets nested under list item 1.
This issue wasn’t there until v0.55.5. The last good Hugo version without this regression is v0.55.4.
Recreating this issue is very easy; just clone the below repo and run it with Hugo v0.55.4 vs Hugo v0.55.5, and see the difference:
My best bet is that this commit in Blackfriday caused this regression.
The regression was seen in Hugo in v0.55.5, because it’s in that version that Blackfriday version was bumped to version v1.5.2 in this commit.
Example snippet
- List item 1
```md
*abc*
/def/
=def=
```
- List item 2
Rendering of above in Hugo v0.55.4
<ul>
<li><p>List item 1</p>
<pre><code class="language-md">*abc*
/def/
=def=
</code></pre></li>
<li><p>List item 2</p></li>
</ul>
List item 1
*abc* /def/ =def=
List item 2
Rendering of above in Hugo v0.55.5 (regression)
<ul>
<li><p>List item 1</p>
<pre><code class="language-md">*abc*
/def/
=def=
</code></pre>
<ul>
<li>List item 2</li>
</ul></li>
</ul>
List item 1
*abc* /def/ =def=
- List item 2
/cc @aignas Can you review if your commit referenced above caused this regression and can you please fix it?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (5 by maintainers)
Commits related to this issue
- deps: Revert to an older version of Blackfriday See #6040 — committed to gohugoio/hugo by bep 5 years ago
In Hugo 0.58.1, this problem is still happening.
Yes, I think it would be worth a try until another release of
blackfriday
. If you still see issues with fenced code blocks and lists, I could probably help to iron out the remaining issues. I have added a few tests toblackfriday
, but I suspect that there may be some more edge cases to cover there.Hi, thanks for pinging me. If I understand correctly, the regression you are seeing was actually introduced with https://github.com/russross/blackfriday/pull/476 and my change in https://github.com/russross/blackfriday/commit/a477dd1646916742841ed20379f941cfa6c5bb6f actually fixes the issue.
I don’t think there has been a release of blackfriday
v1.x
, which includes my fix, because v1.5.2 does not include the commit. Given, that the latestv1.x
version includes a regression, that is fixed inmaster
, it would be great to seev1.5.3
including my fix referenced above, but I am not sure about the plans of maintainers ofblackfriday
itself.cc: @rtfb, who is currently the maintainer of the
blackfriday
, so that he is aware of the situation.