Skip to content

Commit d56f33f

Browse files
authored
Merge pull request #317 from eccenca/feature/htmlFormattedEmail-CMEM-6763
Added v6 Codemirror package support for html CMEM-6763
2 parents bd8f403 + d2eee18 commit d56f33f

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
"@codemirror/lang-sql": "^6.8.0",
8080
"@codemirror/lang-xml": "^6.1.0",
8181
"@codemirror/lang-yaml": "^6.1.2",
82+
"@codemirror/lang-html": "^6.4.9",
8283
"@codemirror/legacy-modes": "^6.5.0",
8384
"@mavrin/remark-typograf": "^2.2.0",
8485
"@xyflow/react": "^12.6.0",

src/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { markdown } from "@codemirror/lang-markdown";
55
import { sql } from "@codemirror/lang-sql";
66
import { xml } from "@codemirror/lang-xml";
77
import { yaml } from "@codemirror/lang-yaml";
8+
import {html} from "@codemirror/lang-html"
9+
810
import { defaultHighlightStyle, LanguageSupport, StreamLanguage, StreamParser } from "@codemirror/language";
911
//legacy mode imports
1012
import { jinja2 } from "@codemirror/legacy-modes/mode/jinja2";
@@ -30,6 +32,7 @@ const supportedModes = {
3032
mathematica,
3133
sql,
3234
javascript,
35+
html
3336
} as const;
3437

3538
export const supportedCodeEditorModes = Object.keys(supportedModes) as Array<keyof typeof supportedModes>;
@@ -42,6 +45,7 @@ const v6AdaptedModes: ReadonlyMap<SupportedCodeEditorModes, boolean> = new Map([
4245
["sql", true],
4346
["yaml", true],
4447
["javascript", true],
48+
["html", true]
4549
]);
4650

4751
export const useCodeMirrorModeExtension = (mode?: SupportedCodeEditorModes) => {

0 commit comments

Comments
 (0)