prosemirror-highlight
Version:
A ProseMirror plugin to highlight code blocks
15 lines (13 loc) • 448 B
JavaScript
import { t as fillFromRoot } from "./hast-Cn9tqyqN.js";
//#region src/lowlight.ts
function createParser(lowlight) {
return function highlighter({ content, language, pos }) {
const root = language ? lowlight.highlight(language, content) : lowlight.highlightAuto(content);
const decorations = [];
fillFromRoot(decorations, root, pos + 1);
return decorations;
};
}
//#endregion
export { createParser };
//# sourceMappingURL=lowlight.js.map