From 973d9c21926e09ff52affb891e4bc602e34cc0e4 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 18 May 2025 21:42:40 +0300 Subject: [PATCH] feat(highlighting): add swift --- docs/Release Notes/Release Notes/v0.94.0.md | 1 + packages/highlightjs/src/syntax_highlighting.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/Release Notes/Release Notes/v0.94.0.md b/docs/Release Notes/Release Notes/v0.94.0.md index 2090a4629..5d3d37d08 100644 --- a/docs/Release Notes/Release Notes/v0.94.0.md +++ b/docs/Release Notes/Release Notes/v0.94.0.md @@ -44,6 +44,7 @@ * Added support for Perl. * Added support for Scala. * Added support for Scheme. + * Added support for Swift. * Mermaid diagrams: basic syntax highlight (not all diagram types are supported) and code folding. * Slight organization in Appearance settings: code block themes are now in "Text Notes", added a "Related settings" section in Appearance. * [Added support for opening and activating a note in a new tab using Ctrl+Shift+click on notes in the launcher pane, note tree, or note images](https://github.com/TriliumNext/Notes/pull/1854) by @SiriusXT diff --git a/packages/highlightjs/src/syntax_highlighting.ts b/packages/highlightjs/src/syntax_highlighting.ts index a7bcae0c9..98edaca3e 100644 --- a/packages/highlightjs/src/syntax_highlighting.ts +++ b/packages/highlightjs/src/syntax_highlighting.ts @@ -146,7 +146,7 @@ const byMimeType: MimeRecord = { "text/x-stex": null, "text/x-stsrc": () => import("highlight.js/lib/languages/smalltalk"), "text/x-styl": () => import("highlight.js/lib/languages/stylus"), - "text/x-swift": null, + "text/x-swift": () => import("highlight.js/lib/languages/swift"), "text/x-systemverilog": null, "text/x-tcl": () => import("highlight.js/lib/languages/tcl"), "text/x-textile": null,