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

highlightling: Remove noHl (which has undefined behaviour) #9885

Closed
hofbi opened this issue May 12, 2022 · 4 comments · Fixed by #13208
Closed

highlightling: Remove noHl (which has undefined behaviour) #9885

hofbi opened this issue May 12, 2022 · 4 comments · Fixed by #13208

Comments

@hofbi
Copy link

hofbi commented May 12, 2022

What version of Hugo are you using (hugo version)?

$ hugo version
0.95

Does this issue reproduce with the latest release?

I am using the docker version, so waiting for klakegg/docker-hugo#64 to be merged

Problem

Based on HugoBlox/hugo-blox-builder#2708, we observed

<span> instances are being inserted by Hugo which we would assume shouldn't happen when Hugo is configured with noHl: true. It's either a Hugo bug with the noHl option or there's an opportunity for Hugo team to allow the Hugo code block parser to be used to detect Mermaid diagram code blocks without highlighting any code or injecting any <span>.

The <span> instances being inserted cause rendering issues for code blocks in markdown slides.

@bep
Copy link
Member

bep commented May 25, 2022

I must admit that I don't know what noHl was meant to mean. I suspect it was something we dragged over from Pygments. Maybe @jmooring could shed some light on this, but currently

If hl=true:

  1. If you have a known lang/lexer, we always highlights
  2. Else, we just wrap the code in a pre.

@jmooring
Copy link
Member

I don't know what noHl was meant to mean

Same here, but I do know that the behavior changed a bit when we removed https://github.com/yuin/goldmark-highlighting in v0.93.0.

This option/attribute has never been documented, other than its presence in docs.json. If it were up to me, I'd remove the option and see what breaks in the wild.

@bep bep changed the title <span...> insertion into code blocks while using with noHl: true highlightling: Remove noHl (which has undefined behaviour) May 26, 2022
@bep
Copy link
Member

bep commented May 26, 2022

@hofbi I understand that the action suggested above does not solve your issue.

@bep bep modified the milestones: v0.100.0, v0.101.0 May 31, 2022
@bep bep modified the milestones: v0.101.0, v0.102.0 Jun 16, 2022
@bep bep modified the milestones: v0.102.0, v0.103.0 Aug 28, 2022
@bep bep modified the milestones: v0.103.0, v0.104.0 Sep 15, 2022
@bep bep modified the milestones: v0.104.0, v0.105.0 Sep 23, 2022
@bep bep modified the milestones: v0.105.0, v0.106.0 Oct 26, 2022
@bep bep modified the milestones: v0.106.0, v0.107.0 Nov 18, 2022
@bep bep modified the milestones: v0.107.0, v0.108.0 Dec 3, 2022
@bep bep modified the milestones: v0.108.0, v0.109.0 Dec 14, 2022
@bep bep modified the milestones: v0.109.0, v0.111.0 Jan 26, 2023
@bep bep modified the milestones: v0.115.0, v0.116.0 Jun 30, 2023
@bep bep modified the milestones: v0.116.0, v0.117.0 Aug 1, 2023
@bep bep modified the milestones: v0.117.0, v0.118.0 Aug 30, 2023
@bep bep modified the milestones: v0.118.0, v0.119.0 Sep 15, 2023
@bep bep modified the milestones: v0.119.0, v0.120.0 Oct 5, 2023
@bep bep modified the milestones: v0.120.0, v0.121.0 Oct 31, 2023
@bep bep modified the milestones: v0.121.0, v0.122.0 Dec 6, 2023
@bep bep modified the milestones: v0.122.0, v0.123.0, v0.124.0 Jan 27, 2024
@bep bep modified the milestones: v0.124.0, v0.125.0 Mar 4, 2024
@bep bep modified the milestones: v0.125.0, Unscheduled Oct 23, 2024
jmooring added a commit to jmooring/hugo that referenced this issue Dec 31, 2024
@bep bep closed this as completed in 2db43f8 Dec 31, 2024
Copy link

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 Jan 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants