From 788787db5b81cefdbc72c7282a33375439b4d643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Thu, 6 Jan 2022 13:42:07 +0100 Subject: [PATCH] Copy button for md code blocks (#1902) Adds a small "copy to clipboard" button in the upper right corner of code blocks in rendered markdown files. Additionally this removes the trailing lines in such code blocks. Co-authored-by: Eduard Heimbuch Co-authored-by: Matthias Thieroff --- gradle/changelog/copy_button.yaml | 3 +++ scm-ui/ui-webapp/public/locales/de/commons.json | 3 +++ scm-ui/ui-webapp/public/locales/en/commons.json | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 gradle/changelog/copy_button.yaml diff --git a/gradle/changelog/copy_button.yaml b/gradle/changelog/copy_button.yaml new file mode 100644 index 0000000000..f5144f2b03 --- /dev/null +++ b/gradle/changelog/copy_button.yaml @@ -0,0 +1,3 @@ +- type: added + description: Add copy button for markdown code blocks ([#1902](https://github.com/scm-manager/scm-manager/pull/1902)) + diff --git a/scm-ui/ui-webapp/public/locales/de/commons.json b/scm-ui/ui-webapp/public/locales/de/commons.json index 16337fcdd4..eaba13c63b 100644 --- a/scm-ui/ui-webapp/public/locales/de/commons.json +++ b/scm-ui/ui-webapp/public/locales/de/commons.json @@ -151,6 +151,9 @@ "importLog": { "title": "Importprotokoll" }, + "syntaxHighlighting": { + "copyButton": "In die Zwischenablage kopieren" + }, "notifications": { "toastTitle": "Benachrichtigung", "xMore": "+{{ count }} Benachrichtigung", diff --git a/scm-ui/ui-webapp/public/locales/en/commons.json b/scm-ui/ui-webapp/public/locales/en/commons.json index 24cf4cd106..323344d967 100644 --- a/scm-ui/ui-webapp/public/locales/en/commons.json +++ b/scm-ui/ui-webapp/public/locales/en/commons.json @@ -152,6 +152,9 @@ "importLog": { "title": "Import Log" }, + "syntaxHighlighting": { + "copyButton": "Copy to clipboard" + }, "notifications": { "toastTitle": "Notification", "xMore": "+{{ count }} Notification",