We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
transformerMetaWordHighlight
When using transformerMetaWordHighlight to highlight words that overlap, Shiki fails.
Example:
```js /xx/ xxx ``` .
Shiki will try to create two spans with class highlighted-word: (xx)x and x(xx) and will result in the following error:
spans
highlighted-word
(xx)x
x(xx)
Failed to parse Markdown file "...": Decorations {"line":0,"character":0,"offset":0} and {"line":0,"character":1,"offset":1} intersect.
Perhaps a way to fix is to allow highlighting words by character position?
On a related note, why the use of /.../ that resembles regex?
/.../
https://stackblitz.com/edit/shiki-intersect?file=src%2Fpages%2Findex.astro,astro.config.mjs,src%2Fcomponents%2Ftest.md
The text was updated successfully, but these errors were encountered:
Perhaps instead of doing this:
shiki/packages/transformers/src/transformers/meta-highlight-word.ts
Line 43 in c55865f
it would be easier to just use regex to get the match indices?
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Validations
Describe the bug
When using
transformerMetaWordHighlight
to highlight words that overlap, Shiki fails.Example:
Shiki will try to create two
spans
with classhighlighted-word
:(xx)x
andx(xx)
and will result in the following error:Perhaps a way to fix is to allow highlighting words by character position?
On a related note, why the use of
/.../
that resembles regex?Reproduction
https://stackblitz.com/edit/shiki-intersect?file=src%2Fpages%2Findex.astro,astro.config.mjs,src%2Fcomponents%2Ftest.md
Contributes
The text was updated successfully, but these errors were encountered: