Skip to content

Commit fe0e4cb

Browse files
committed
fix(rehype)!: deprecate and disable highlightLines option
1 parent 21e9955 commit fe0e4cb

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

docs/packages/rehype.md

+4
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ const file = await unified()
8383

8484
### Line Highlight
8585

86+
::: note
87+
This is deprecated. It's disabled by default in `v0.10.0` and will be removed in the next minor. Consider use [`transformerNotationHighlight`](https://shikiji.netlify.app/packages/transformers#transformernotationhighlight) instead.
88+
:::
89+
8690
In addition to the features of `shikiji`, this plugin also supports line highlighting. You can specify line numbers to highlight after the language name in the format `{<line-numbers>}` - a comma separated list of `<line-number>`s, wrapped in curly braces. Each line number can be a single number (e.g. `{2}` highlights line 2 and `{1,4}` highlights lines 1 and 4) or a range (e.g. `{5-7}` highlights lines 1 through 7, and `{1-3,5-6}` highlights lines 1 through 3 and 5 through 6). For example:
8791

8892
````md

packages/rehype-shikiji/src/core.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export interface RehypeShikijiExtraOptions {
1616
/**
1717
* Add `highlighted` class to lines defined in after codeblock
1818
*
19-
* @default true
19+
* @deprecated Use [transformerNotationHighlight](https://shikiji.netlify.app/packages/transformers#transformernotationhighlight) instead
20+
* @default false
2021
*/
2122
highlightLines?: boolean | string
2223

@@ -62,7 +63,7 @@ const rehypeShikijiFromHighlighter: Plugin<[HighlighterGeneric<any, any>, Rehype
6263
options,
6364
) {
6465
const {
65-
highlightLines = true,
66+
highlightLines = false,
6667
addLanguageClass = false,
6768
parseMetaString,
6869
cache,

0 commit comments

Comments
 (0)