Comments (5)
I guess it's not well-documented. It was migrated from https://github.com/innocenzi/shiki-processor and I kept the original behavior.
You can do // [!code highlight:2]
on the first line to highlight the following two lines.
from shiki.
This is intentional and expected behavior. I am ok with exposing an option to toggle that, pr welcome
from shiki.
Thanks for the reply. It feels a little unexpected since the span.line
is not removed unless there is a notation comment. Updated example above to demonstrate. Is this documented?
How would you indicate a diff that includes a new line as part of the code change?
from shiki.
Thanks, that gets me across the line for now.
I still think that this is probably still a bug since it is doing the opposite of what the notation comment is suggesting it will. Combined with the transformerRemoveLineBreak
transformer and a .line { display: block }
then the output wraps onto the previous line.
I'd like to suggest that an option to toggle is added, but the default behavior be that it just does what the comment says it will. I'm happy to submit a PR.
from shiki.
Small follow-up to document behavior. The multi-line notation // [!code highlight:2]
also removes the starting span.line
if the comment is on an otherwise empty line.
from shiki.
Related Issues (20)
- [QUESTION] How to load type in twoslash when using auto import ? HOT 1
- Text and caret offset in playground while scrolling
- `transformerNotationDiff` and `transformerNotationHighlight` don't apply any styles to code blocks HOT 4
- Visible scrollbars on Firefox
- `shellsession` language not highlighting first command HOT 5
- Idea: Rename `@shikijs/transformers` 'notation' transformers -> 'comment' HOT 1
- Change `@shikijs/transformers` range by `+ 1`
- Idea: Start/Stop Transformer blocks
- Add gleam language HOT 1
- Mangled code output with @shikijs/twoslash HOT 1
- Add option to configure tokenizeMaxLineLength and tokenizeTimeLimit in @shikijs/monaco HOT 1
- Template literals in Monaco editor HOT 1
- [Feature Request] pass filename to `filter` option of `@shikijs/vitepress-twoslash` HOT 1
- `@shikijs/rehype`: keep hast element `data` and `properties` HOT 1
- `shiki support tiptap`: can shiki support tiptap editor HOT 1
- `highlight-word-range`: selected which selected words to highlight
- `@shikijs/rehype` backgroundColor instead of background-color in style attribute HOT 2
- 💡 Shiki Editor HOT 2
- Add `package.json` export for package.json of shiki
- [🐞BUG]: `colorReplacements` not working on the `<pre>` container HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shiki.