You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then transformerNotationHighlight can do it's normal thing.
It works with any existing transformer which accepts a 'range' e.g. :4 as a parameter.
PR
I've written this transformer in a project I'm working on, If you'd accept a PR for this transformer let me know and I'll hopefully be able to create a PR for it 👍
Let me know what naming conventions etc. you'd like (my proposal introduces a - but that might not be what you had in mind)
Reproduction
idea, no repro
Contributes
I am willing to submit a PR to fix this issue
I am willing to submit a PR with failing tests
The text was updated successfully, but these errors were encountered:
Validations
Describe the bug
This suggestion applies to any common transformers which support range.
I'll use
// [!code highlight]
as an example.When using
@shikijs/transformers
there are 3 options for highlighting many (N
) lines of code:a)
N
comments.b)
4
->5
(brittle)c)
1-3
->1-4
(brittle)Idea: Start and Stop blocks.
Inspiration:
// prettier-ignore-start
and// prettier-ignore-end
: https://prettier.io/docs/en/ignore.html#range-ignoreNew transformer:
transformerStartEndRange
Usage:
This transformer transforms code like this:
Becomes:
Then
transformerNotationHighlight
can do it's normal thing.It works with any existing transformer which accepts a 'range' e.g.
:4
as a parameter.PR
I've written this transformer in a project I'm working on, If you'd accept a PR for this transformer let me know and I'll hopefully be able to create a PR for it 👍
Let me know what naming conventions etc. you'd like (my proposal introduces a
-
but that might not be what you had in mind)Reproduction
idea, no repro
Contributes
The text was updated successfully, but these errors were encountered: