From b177e7a637d5e2163e2e78365e75c474a2ad15ca Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 26 May 2025 15:19:53 +0300 Subject: [PATCH] feat(client/read-only-text): implement copying to clipboard --- apps/client/src/services/syntax_highlight.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/client/src/services/syntax_highlight.ts b/apps/client/src/services/syntax_highlight.ts index 0cb7cbf2d..0e4a2f031 100644 --- a/apps/client/src/services/syntax_highlight.ts +++ b/apps/client/src/services/syntax_highlight.ts @@ -1,6 +1,7 @@ import { ensureMimeTypes, highlight, highlightAuto, loadTheme, Themes } from "@triliumnext/highlightjs"; import mime_types from "./mime_types.js"; import options from "./options.js"; +import toast from "./toast.js"; let highlightingLoaded = false; @@ -33,7 +34,17 @@ export async function formatCodeBlocks($container: JQuery) { export function applyCopyToClipboardButton($codeBlock: JQuery) { const $copyButton = $("