Skip to content

Build your personal knowledge base with Trilium Notes

chore(code): integrate Smarty support

Elian Doran2fe09147fd61
diff --git a/packages/codemirror/package.json b/packages/codemirror/package.json
index 6de59e301c..8b88be0024 100644
--- a/packages/codemirror/package.json
+++ b/packages/codemirror/package.json
@@ -26,6 +26,7 @@
"@codemirror/legacy-modes": "6.5.1",
"@codemirror/search": "6.5.10",
"@codemirror/view": "6.36.7",
+ "@ssddanbrown/codemirror-lang-smarty": "1.0.0",
"@ssddanbrown/codemirror-lang-twig": "1.0.0",
"codemirror-lang-hcl": "0.1.0"
}
diff --git a/packages/codemirror/src/augmentation.d.ts b/packages/codemirror/src/augmentation.d.ts
new file mode 100644
index 0000000000..ec543f798e
--- /dev/null
+++ b/packages/codemirror/src/augmentation.d.ts
@@ -0,0 +1,4 @@
+declare module "@ssddanbrown/codemirror-lang-smarty" {
+ import type { StreamParser } from "@codemirror/language"
+ export const smarty: StreamParser<unknown>;
+}
diff --git a/packages/codemirror/src/syntax_highlighting.ts b/packages/codemirror/src/syntax_highlighting.ts
index 81ef55ce4a..36a588a4c7 100644
--- a/packages/codemirror/src/syntax_highlighting.ts
+++ b/packages/codemirror/src/syntax_highlighting.ts
@@ -134,7 +134,7 @@ const byMimeType: Record<string, (() => Promise<StreamParser<unknown> | Language
"text/x-scss": async () => (await import('@codemirror/legacy-modes/mode/css')).sCSS,
"text/x-sh": async () => (await import('@codemirror/legacy-modes/mode/shell')).shell,
"text/x-slim": null,
- "text/x-smarty": null,
+ "text/x-smarty": async () => ((await import('@ssddanbrown/codemirror-lang-smarty')).smarty),
"text/x-sml": async () => (await import('@codemirror/legacy-modes/mode/mllike')).sml,
"text/x-solr": async () => (await import('@codemirror/legacy-modes/mode/solr')).solr,
"text/x-soy": null,
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7822975da6..b293d5c204 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1175,6 +1175,9 @@ importers:
'@codemirror/view':
specifier: 6.36.7
version: 6.36.7
+ '@ssddanbrown/codemirror-lang-smarty':
+ specifier: 1.0.0
+ version: 1.0.0
'@ssddanbrown/codemirror-lang-twig':
specifier: 1.0.0
version: 1.0.0
@@ -4491,6 +4494,9 @@ packages:
'@socket.io/[email protected]':
resolution: {integrity: sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==}
+ '@ssddanbrown/[email protected]':
+ resolution: {integrity: sha512-F0ut1kmdbT3eORk3xVIKfQsGCZiQdh+6sLayBa0+FTex2gyIQlVQZRRA7bPSlchI3uZtWwNnqGNz5O/QLWRlFg==}
+
'@ssddanbrown/[email protected]':
resolution: {integrity: sha512-7WIMIh8Ssc54TooGCY57WU2rKEqZZrcV2tZSVRPtd0gKYsrDEKCSLWpQjUWEx7bdgh3NKHUjq1O4ugIzI/+dwQ==}
@@ -15071,6 +15077,14 @@ snapshots:
- supports-color
- utf-8-validate
+ '@ckeditor/[email protected]':
+ dependencies:
+ '@ckeditor/ckeditor5-core': 45.0.0([email protected])([email protected])
+ '@ckeditor/ckeditor5-icons': 45.0.0
+ '@ckeditor/ckeditor5-ui': 45.0.0([email protected])([email protected])
+ '@ckeditor/ckeditor5-utils': 45.0.0([email protected])([email protected])
+ ckeditor5: 45.0.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
+
dependencies:
'@ckeditor/ckeditor5-core': 45.0.0([email protected])([email protected])
@@ -19521,6 +19535,8 @@ snapshots:
'@socket.io/[email protected]': {}
+ '@ssddanbrown/[email protected]': {}
+
'@ssddanbrown/[email protected]':
dependencies:
'@codemirror/language': 6.11.0
@@ -21767,7 +21783,7 @@ snapshots:
[email protected](patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41):
dependencies:
'@ckeditor/ckeditor5-adapter-ckfinder': 45.0.0
- '@ckeditor/ckeditor5-alignment': 45.0.0([email protected])([email protected])
+ '@ckeditor/ckeditor5-alignment': 45.0.0
'@ckeditor/ckeditor5-autoformat': 45.0.0
'@ckeditor/ckeditor5-autosave': 45.0.0([email protected])([email protected])
'@ckeditor/ckeditor5-basic-styles': 45.0.0