
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
prosemirror-lezer
Advanced tools
Warning This is an experimental plugin forked from b-kelly/prosemirror-highlightjs. In its current state, this should not be used in production, as I'm not sure if I'll be maintaining this moving forward.
import { parser } from "@lezer/markdown";
import { highlightPlugin } from "prosemirror-lezer";
// parsers are keyed by language or optionally `*` as a fallback
const parsers = {
"markdown": parser,
};
let state = new EditorView(..., {
state: EditorState.create({
doc: ...,
plugins: [highlightPlugin(parsers)],
})
});
Or import just the decoration parser and write your own plugin:
import { getHighlightDecorations } from "prosemirror-lezer";
let plugin = new Plugin({
state: {
init(config, instance) {
let content = getHighlightDecorations(
instance.doc,
parsers,
blockTypes,
languageExtractor
);
return DecorationSet.create(instance.doc, content);
},
apply(tr, set) {
if (!tr.docChanged) {
return set.map(tr.mapping, tr.doc);
}
let content = getHighlightDecorations(
tr.doc,
parsers,
blockTypes,
languageExtractor
);
return DecorationSet.create(tr.doc, content);
},
},
props: {
decorations(state) {
return this.getState(state);
},
},
});
FAQs
ProseMirror plugin to highlight code with Lezer grammars
The npm package prosemirror-lezer receives a total of 955 weekly downloads. As such, prosemirror-lezer popularity was classified as not popular.
We found that prosemirror-lezer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.