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

Hugo v0.55.5 regression: Blackfriday version downgrade breaks rendering of list/code block #6040

Closed
kaushalmodi opened this issue Jun 16, 2019 · 15 comments

Comments

@kaushalmodi
Copy link
Contributor

kaushalmodi commented Jun 16, 2019

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?

@aignas
Copy link

aignas commented Jun 16, 2019

Hi, thanks for pinging me. If I understand correctly, the regression you are seeing was actually introduced with russross/blackfriday#476 and my change in russross/blackfriday@a477dd1 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.

@kaushalmodi
Copy link
Contributor Author

@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.

@kaushalmodi kaushalmodi changed the title Hugo v0.55.5 regression: Blackfriday upgrade breaks rendering of list/code block Hugo v0.55.5 regression: Blackfriday version downgrade breaks rendering of list/code block Jun 16, 2019
@bep
Copy link
Member

bep commented Jun 16, 2019

@aignas so if Hugo pinned BF to russross/blackfriday@a477dd1 Hugo should be good (or in better shape)? I do like to have versioned dependencies, but we can do this as a temp fix.

@aignas
Copy link

aignas commented Jun 16, 2019

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 added a commit that referenced this issue Jun 16, 2019
@kaushalmodi
Copy link
Contributor Author

@bep Thanks. Btw looking at your commit message "Revert to an older version of Blackfriday", the Blackfriday a477dd164 commit ( russross/blackfriday@a477dd1, Jan 24 2019 ) is actually a newer commit than the Blackfriday v1.5.2 commit ( russross/blackfriday@05f3235, Sep 17 2018 ).

I'll build hugo from master and try it out.

@kaushalmodi
Copy link
Contributor Author

I confirm that using russross/blackfriday@a477dd1 in Hugo fixes this issue.

@pirivan
Copy link

pirivan commented Jun 24, 2019

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?

@nickolashkraus
Copy link

@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

@pirivan
Copy link

pirivan commented Jun 27, 2019

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 :-(

@ghost
Copy link

ghost commented Jul 2, 2019

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

@pirivan
Copy link

pirivan commented Jul 3, 2019

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!

@hien
Copy link

hien commented Sep 12, 2019

In Hugo 0.58.1, this problem is still happening.

@stale
Copy link

stale bot commented Feb 27, 2020

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.

@stale stale bot added the Stale label Feb 27, 2020
@kaushalmodi
Copy link
Contributor Author

Closing this as it's related to Blackfriday.

@github-actions
Copy link

github-actions bot commented Feb 6, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants