prosemirror-highlight
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -0,4 +1,4 @@ | ||
import { Node } from 'prosemirror-model'; | ||
import { Transaction, Plugin } from 'prosemirror-state'; | ||
import { Decoration, DecorationSet } from 'prosemirror-view'; | ||
import { Node } from 'prosemirror-model'; | ||
import { P as Parser, L as LanguageExtractor } from './types-wUmJTPF3.js'; | ||
@@ -85,2 +85,2 @@ | ||
export { DecorationCache, type HighlightPluginState, createHighlightPlugin }; | ||
export { DecorationCache, type HighlightPluginState, LanguageExtractor, Parser, createHighlightPlugin }; |
@@ -1,8 +0,1 @@ | ||
import "./chunk-YSQDPG26.js"; | ||
// src/plugin.ts | ||
import "prosemirror-model"; | ||
import { Plugin, PluginKey } from "prosemirror-state"; | ||
import { DecorationSet } from "prosemirror-view"; | ||
// src/cache.ts | ||
@@ -85,2 +78,5 @@ import "prosemirror-model"; | ||
// src/plugin.ts | ||
import "prosemirror-model"; | ||
import { Plugin, PluginKey } from "prosemirror-state"; | ||
import { DecorationSet } from "prosemirror-view"; | ||
function createHighlightPlugin({ | ||
@@ -87,0 +83,0 @@ parser, |
@@ -1,3 +0,1 @@ | ||
import "./chunk-YSQDPG26.js"; | ||
// src/lowlight.ts | ||
@@ -4,0 +2,0 @@ import { Decoration } from "prosemirror-view"; |
{ | ||
"name": "prosemirror-highlight", | ||
"type": "module", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"packageManager": "pnpm@8.10.0", | ||
@@ -30,2 +30,5 @@ "description": "A ProseMirror plugin to highlight code blocks", | ||
"default": "./src/shiki.ts" | ||
}, | ||
"./shikiji": { | ||
"default": "./src/shikiji.ts" | ||
} | ||
@@ -49,8 +52,20 @@ }, | ||
"highlight.js": "^11.9.0", | ||
"lowlight": "^3.1.0", | ||
"prosemirror-model": "^1.19.3", | ||
"prosemirror-state": "^1.4.3", | ||
"prosemirror-transform": "^1.8.0", | ||
"prosemirror-view": "^1.32.4" | ||
"prosemirror-view": "^1.32.4", | ||
"shiki": "^0.14.6", | ||
"shikiji": "^0.8.0" | ||
}, | ||
"peerDependenciesMeta": { | ||
"@types/hast": { | ||
"optional": true | ||
}, | ||
"highlight.js": { | ||
"optional": true | ||
}, | ||
"lowlight": { | ||
"optional": true | ||
}, | ||
"prosemirror-model": { | ||
@@ -68,6 +83,6 @@ "optional": true | ||
}, | ||
"highlight.js": { | ||
"shiki": { | ||
"optional": true | ||
}, | ||
"@types/hast": { | ||
"shikiji": { | ||
"optional": true | ||
@@ -93,2 +108,3 @@ } | ||
"shiki": "^0.14.6", | ||
"shikiji": "^0.8.0", | ||
"tsup": "^8.0.1", | ||
@@ -115,2 +131,6 @@ "typescript": "^5.2.2", | ||
"default": "./dist/shiki.js" | ||
}, | ||
"./shikiji": { | ||
"types": "./dist/shikiji.d.ts", | ||
"default": "./dist/shikiji.js" | ||
} | ||
@@ -128,2 +148,3 @@ }, | ||
"renovate": { | ||
"dependencyDashboard": true, | ||
"extends": [ | ||
@@ -130,0 +151,0 @@ "github>ocavue/config-renovate" |
@@ -27,2 +27,18 @@ # prosemirror-highlight | ||
### With [Shikiji] | ||
```ts | ||
import { getHighlighter } from 'shikiji' | ||
import { createHighlightPlugin } from 'prosemirror-highlight' | ||
import { createParser } from 'prosemirror-highlight/shikiji' | ||
const highlighter = await getHighlighter({ | ||
themes: ['vitesse-light'], | ||
langs: ['javascript', 'typescript', 'python'], | ||
}) | ||
const parser = createParser(highlighter) | ||
export const shikijiPlugin = createHighlightPlugin({ parser }) | ||
``` | ||
### With [lowlight] (based on [Highlight.js]) | ||
@@ -60,1 +76,2 @@ | ||
[Shiki]: https://github.com/shikijs/shiki | ||
[Shikiji]: https://github.com/antfu/shikiji |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
12
76
0
1
18455
9
21
380