8000 fix(markdown-it)!: deprecate and disable `highlightLines` option · antfu/shikiji@21e9955 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 21e9955

Browse files
committed
fix(markdown-it)!: deprecate and disable highlightLines option
1 parent c5c71c6 commit 21e9955

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

docs/packages/markdown-it.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ md.use(fromHighlighter(highlighter, { /* options */ }))
5656

5757
### Line Highlight
5858

59+
::: note
60+
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.
61+
:::
62+
5963
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:
6064

6165
````md

packages/markdown-it-shikiji/src/core.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ export interface MarkdownItShikijiExtraOptions {
77
/**
88
* Add `highlighted` class to lines defined in after codeblock
99
*
10-
* @default true
10+
* @deprecated Use [transformerNotationHighlight](https://shikiji.netlify.app/packages/transformers#transformernotationhighlight) instead
11+
* @default false
1112
*/
1213
highlightLines?: boolean | string
1314

@@ -34,7 +35,7 @@ export function setupMarkdownIt(
3435
options: MarkdownItShikijiSetupOptions,
3536
) {
3637
const {
37-
highlightLines = true,
38+
highlightLines = false,
3839
parseMetaString,
3940
} = options
4041

0 commit comments

Comments
 (0)
0