Add HTML code blocks

pull/503/head
Zef Hemel 2023-08-15 07:56:11 +02:00
parent 01ad45f929
commit cf97d04b1b
2 changed files with 6 additions and 0 deletions

View File

@ -106,6 +106,7 @@ export {
} from "https://esm.sh/@codemirror/legacy-modes@6.3.2/mode/sql?external=@codemirror/language&target=es2022";
export { rust as rustLanguage } from "https://esm.sh/@codemirror/legacy-modes@6.3.2/mode/rust?external=@codemirror/language&target=es2022";
export { css as cssLanguage } from "https://esm.sh/@codemirror/legacy-modes@6.3.2/mode/css?external=@codemirror/language&target=es2022";
export { html as htmlLanguage } from "@codemirror/lang-html";
export { python as pythonLanguage } from "https://esm.sh/@codemirror/legacy-modes@6.3.2/mode/python?external=@codemirror/language&target=es2022";
export { protobuf as protobufLanguage } from "https://esm.sh/@codemirror/legacy-modes@6.3.2/mode/protobuf?external=@codemirror/language&target=es2022";
export { shell as shellLanguage } from "https://esm.sh/@codemirror/legacy-modes@6.3.2/mode/shell?external=@codemirror/language&target=es2022";

View File

@ -61,6 +61,7 @@ import {
attachmentExtension,
pasteLinkExtension,
} from "./cm_plugins/editor_paste.ts";
import { htmlLanguage } from "https://esm.sh/v130/@codemirror/lang-html@6.4.3/X-ZS9AY29kZW1pcnJvci9hdXRvY29tcGxldGUsQGNvZGVtaXJyb3IvbGFuZy1jc3MsQGNvZGVtaXJyb3IvbGFuZ3VhZ2UsQGNvZGVtaXJyb3Ivc3RhdGUsQGxlemVyL2h0bWwsQGxlemVyL2xy/dist/index.js";
export function createEditorState(
editor: Client,
@ -159,6 +160,10 @@ export function createEditorState(
name: "css",
support: new LanguageSupport(StreamLanguage.define(sqlLanguage)),
}),
LanguageDescription.of({
name: "html",
support: new LanguageSupport(htmlLanguage),
}),
LanguageDescription.of({
name: "python",
alias: ["py"],