@jinntec/jinn-codemirror
Version:
Source code editor component based on codemirror with language support for XML and Leiden+
18 lines (17 loc) • 450 B
JavaScript
import { EditorConfig } from "./config";
import { html } from "@codemirror/lang-html";
import { commands, encloseWithPanel } from "./xml-commands";
class HTMLConfig extends EditorConfig {
constructor(editor, toolbar = []) {
super(editor, toolbar, commands);
}
async getExtensions(editor) {
return [html({ selfClosingTags: false }), encloseWithPanel()];
}
serialize() {
return this.editor.content;
}
}
export {
HTMLConfig
};