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 code extensions don't work in some situations #3503

Open
4 tasks done
JMaylor opened this issue Jan 26, 2024 · 2 comments
Open
4 tasks done

Markdown code extensions don't work in some situations #3503

JMaylor opened this issue Jan 26, 2024 · 2 comments
Labels
bug Something isn't working stale upstream Related to the dependencies

Comments

@JMaylor
Copy link

JMaylor commented Jan 26, 2024

Describe the bug

Some of the code markdown extensions do not work when the language is vue.

In particular, [!code ++], [!code --], [!code warning], [!code error] and [!code focus] just show the comments at the end of the line.

Changing the language to something else fixes this, e.g. htmx or ts.

This only seems to happen in the template tags of a vue code block. The highlighting works absolutely fine in the script part. Please see reproduction for code examples, I can't figure out how to escape the triple backtick code blocks here! ☹️

Reproduction

https://stackblitz.com/edit/vite-arupmh?file=docs%2Fexample.md

Expected behavior

The markdown extensions should work correctly and highlight the lines as per the docs.

System Info

System:
  OS: macOS 14.1.2
  CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Memory: 488.47 MB / 16.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
  Yarn: 1.22.10 - /usr/local/bin/yarn
  npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
Browsers:
  Chrome: 120.0.6099.234
  Firefox: 112.0.2
  Firefox Developer Edition: 107.0
  Safari: 17.1.2

Additional context

No response

Validations

@JMaylor JMaylor added the bug: pending triage Maybe a bug, waiting for confirmation label Jan 26, 2024
@brc-dd brc-dd added bug Something isn't working upstream Related to the dependencies and removed bug: pending triage Maybe a bug, waiting for confirmation labels Jan 26, 2024
@JMaylor JMaylor changed the title Markdown cod extensions don't work in some situations Markdown code extensions don't work in some situations Jan 26, 2024
@github-actions github-actions bot added the stale label Mar 7, 2024
@jrson83
Copy link

jrson83 commented Apr 20, 2024

Having the same issue when language is sh or bash using version 1.1.3.

@mak3
Copy link

mak3 commented Sep 18, 2024

Having the same issue when language is sh or bash using version 1.1.3.

@jrson83 For bash/sh you can use # [!code focus]
The difference is # instead of //.
Not sure if it's bug or feature, that laguage specific comment is required

For some basic snippets it's working, but it fails when line ends with backslash, so I can't add focus to multiline snippets.

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

No branches or pull requests

4 participants