mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-30 18:05:55 +01:00 
			
		
		
		
	feat(text-note): add Terraform HCL support for code blocks
This commit is contained in:
		| @@ -80,8 +80,4 @@ return { | |||||||
| } | } | ||||||
| } | } | ||||||
|  |  | ||||||
| module.exports = function(hljs) { | hljs.registerLanguage('terraform', hljsDefineTerraform); | ||||||
|     hljs.registerLanguage('terraform', hljsDefineTerraform); |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| module.exports.definer = hljsDefineTerraform; |  | ||||||
| @@ -107,8 +107,16 @@ const HIGHLIGHT_JS = { | |||||||
|         const scriptsToLoad = new Set(); |         const scriptsToLoad = new Set(); | ||||||
|         scriptsToLoad.add("node_modules/@highlightjs/cdn-assets/highlight.min.js"); |         scriptsToLoad.add("node_modules/@highlightjs/cdn-assets/highlight.min.js"); | ||||||
|         for (const mimeType of mimeTypes) { |         for (const mimeType of mimeTypes) { | ||||||
|             if (mimeType.enabled && mimeType.highlightJs) { |             const id = mimeType.highlightJs; | ||||||
|                 scriptsToLoad.add(`node_modules/@highlightjs/cdn-assets/languages/${mimeType.highlightJs}.min.js`); |             if (!mimeType.enabled || !id) { | ||||||
|  |                 continue; | ||||||
|  |             } | ||||||
|  |  | ||||||
|  |             if (mimeType.highlightJsSource === "libraries") { | ||||||
|  |                 scriptsToLoad.add(`libraries/highlightjs/${id}.js`); | ||||||
|  |             } else { | ||||||
|  |                 // Built-in module. | ||||||
|  |                 scriptsToLoad.add(`node_modules/@highlightjs/cdn-assets/languages/${id}.min.js`); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|          |          | ||||||
|   | |||||||
| @@ -142,6 +142,7 @@ const MIME_TYPES_DICT = [ | |||||||
|     { default: true, title: "Swift", mime: "text/x-swift" }, |     { default: true, title: "Swift", mime: "text/x-swift" }, | ||||||
|     { title: "SystemVerilog", mime: "text/x-systemverilog" }, |     { title: "SystemVerilog", mime: "text/x-systemverilog" }, | ||||||
|     { title: "Tcl", mime: "text/x-tcl", highlightJs: "tcl" }, |     { title: "Tcl", mime: "text/x-tcl", highlightJs: "tcl" }, | ||||||
|  |     { title: "Terraform (HCL)", mime: "text/x-hcl", highlightJs: "terraform", highlightJsSource: "libraries" }, | ||||||
|     { title: "Textile", mime: "text/x-textile" }, |     { title: "Textile", mime: "text/x-textile" }, | ||||||
|     { title: "TiddlyWiki ", mime: "text/x-tiddlywiki" }, |     { title: "TiddlyWiki ", mime: "text/x-tiddlywiki" }, | ||||||
|     { title: "Tiki wiki", mime: "text/tiki" }, |     { title: "Tiki wiki", mime: "text/tiki" }, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user