Hello,
I discovered this issue from this comment in the Discourse forum.
The issue is that for a Markdown snippet:
````
md
*hello*
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.
````
```md
*abc*
/def/
=def=
```
<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
<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=
/cc @aignas Can you review if your commit referenced above caused this regression and can you please fix it?
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 latest v1.x version includes a regression, that is fixed in master, it would be great to see v1.5.3 including my fix referenced above, but I am not sure about the plans of maintainers of blackfriday itself.
cc: @rtfb, who is currently the maintainer of the blackfriday, so that he is aware of the situation.
@aignas Thanks for catching that!
@bep Yes, so the Hugo v0.55.5 rolled back blackfriday to an older buggy version from September 2018: https://github.com/russross/blackfriday/releases/tag/v1.5.2.
@aignas so if Hugo pinned BF to https://github.com/russross/blackfriday/commit/a477dd1646916742841ed20379f941cfa6c5bb6f Hugo should be good (or in better shape)? I do like to have versioned dependencies, but we can do this as a temp fix.
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 to blackfriday, but I suspect that there may be some more edge cases to cover there.
@bep Thanks. Btw looking at your commit message "Revert to an older version of Blackfriday", the Blackfriday a477dd164 commit ( https://github.com/russross/blackfriday/commit/a477dd1646916742841ed20379f941cfa6c5bb6f, Jan 24 2019 ) is actually a newer commit than the Blackfriday v1.5.2 commit ( https://github.com/russross/blackfriday/commit/05f3235734ad95d0016f6a23902f06461fcf567a, Sep 17 2018 ).
I'll build hugo from master and try it out.
I confirm that using https://github.com/russross/blackfriday/commit/a477dd1646916742841ed20379f941cfa6c5bb6f in Hugo fixes this issue.
I'm using Hugo v0.55.6 and this issue broke several posts in my web site. Is there a release of Hugo coming soon with a fix?
@pirivan Simply use Hugo v0.55.4.
To install Hugo v0.55.4 via Homebrew:
# remove symlinks for Hugo formula
brew unlink hugo
# install Hugo v0.55.4
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/cf3219506fd28f7133041b74761e8025418435a3/Formula/hugo.rb
# create symlinks for Hugo v0.55.4
brew switch hugo 0.55.4
# confirm version
hugo version
Thanks for the hint about v0.55.4, which I can try in my local workstation. The problem is that my web pages live in Gitlab and they are built automatically upon updates to the master branch. Gitllab uses the latest available Hugo (isn't it the same for Github web pages?). This is not something that I can change myself directly :-(
Thanks for the hint about v0.55.4, which I can try in my local workstation. The problem is that my web pages live in Gitlab and they are built automatically upon updates to the master branch. Gitllab uses the latest available Hugo (isn't it the same for Github web pages?). This is not something that I can change myself directly :-(
I also use gitlab, my approach to this was, since the docker image from https://github.com/oskapt/docker-hugo does not have a 0.55.4 build. I had to fork and create my own https://hub.docker.com/r/freethebit/hugo.
and in my gitlab-ci.yml using as image: freethebit/hugo:v0.55.4
I tested my build with your image and it worked well. If you don't mind, I'll keep using it until a new version of Hugo becomes available with a fix for this issue.
(And I thought that only images from the Gitlab registry could be used for the CD/CI pipeline. Now I know that they can be in the docker hub as well!)
Thank you!
In Hugo 0.58.1, this problem is still happening.
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.
Closing this as it's related to Blackfriday.