UNPKG

prosemirror-highlight

Version:

A ProseMirror plugin to highlight code blocks

18 lines (16 loc) 388 B
import { fillFromRoot } from "./chunk-ZZGBRRBM.js"; // src/refractor.ts function createParser(refractor) { return function highlighter({ content, language, pos }) { const root = refractor.highlight(content, language || ""); const decorations = []; const from = pos + 1; fillFromRoot(decorations, root, from); return decorations; }; } export { createParser };