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

Markdown Extensions for Code Blocks Not Working Properly with ‘templ’ Language #4515

Closed
4 tasks done
indaco opened this issue Jan 24, 2025 · 1 comment
Closed
4 tasks done
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@indaco
Copy link

indaco commented Jan 24, 2025

Describe the bug

I noticed that certain Markdown extensions for code blocks do not work as expected in VitePress when using the templ language, while they work properly for other languages like js. Specifically:

  • Not Working Properly:
    • Focus in Code Blocks
    • Colored Diffs in Code Blocks
    • Errors and Warnings in Code Blocks
  • Working as Expected:
    • Line Highlighting in Code Blocks

Thanks

Reproduction

https://stackblitz.com/edit/vite-4gtyqrtf?file=docs%2Findex.md

Visit the demo page by clicking the MD Extensions Issue with Templ button on the homepage.

Expected behavior

All supported Markdown extensions for code blocks should render correctly, regardless of the specified language, as long as the language is supported by shiki. Since templ is a supported language, these extensions should work as expected, similar to how Line Highlighting currently works.

System Info

System:
    OS: macOS 15.2
    CPU: (8) arm64 Apple M3
    Memory: 434.31 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.18.1 - ~/.nvm/versions/node/v20.18.1/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.18.1/bin/npm
    pnpm: 9.15.4 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 131.0.6778.267
    Safari: 18.2
  npmPackages:
    vitepress: ^1.6.3 => 1.6.3

Additional context

No response

Validations

@indaco indaco added the bug: pending triage Maybe a bug, waiting for confirmation label Jan 24, 2025
@brc-dd
Copy link
Member

brc-dd commented Jan 24, 2025

Track it with shiki. It's a known issue.

Duplicate of #3503, #4087

@brc-dd brc-dd closed this as completed Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants