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

Alert shortcode placed right after code block w/ line numbers is being rendered incorrectly #987

Open
jwadolowski opened this issue Jan 3, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@jwadolowski
Copy link

Issue description

I've recently noticed that alert shortcode placed right after a code block (w/ line numbers enabled, that's important) results in 2 elements being glued together (there's no vertical space between them, see screenshot below).

Steps to reproduce

  1. hugo new site alert-test --format yaml
  2. cd alert-test && hugo mod init foo
  3. hugo new content content/test.md
  4. mkdir -p config/_default && mv hugo.yaml config/_default
  5. Add config/_default/module.yaml with the following contents:
imports:
  - path: github.com/jpanther/congo/v2
  1. echo "colorScheme: ocean" > config/_default/params.yaml (optional, applies to all colorschemes)
  2. Update content/test.md content so it looks like this gist
  3. hugo server

Current state

localhost_1313_test_

Expected state

Vertical space is rendered between alert and code block.

Noteworthy facts

  1. The issue occurs only when linenos option is used inside code fences

Theme version

v2.10.0

Hugo version

hugo v0.140.2+extended+withdeploy darwin/arm64 BuildDate=2024-12-30T15:01:53Z VendorInfo=brew

Which browser rendering engines are you seeing the problem on?

Chromium (Google Chrome, Microsoft Edge, Brave, Vivaldi, Opera, etc.), Firefox (Mozilla Firefox), WebKit (Safari)

URL to sample repository or website

No response

Hugo output or build error messages

N/A
@jwadolowski jwadolowski added the bug Something isn't working label Jan 3, 2025
@jwadolowski
Copy link
Author

Actually, there's a few more combinations that result in missing vertical spacing:

  1. code block (w/ numbers) + button
  2. code block (w/ numbers) + button + mermaid

cleanshot_2025-01-03T142749_tbHlDm8K@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant