From 12e5b9d18c45ab5cb0766e80a815d266445052f5 Mon Sep 17 00:00:00 2001 From: Andrew Wei Date: Thu, 11 Apr 2024 07:26:50 -0700 Subject: [PATCH] Fix: Remove unwanted leading/trailing whitespaces in attributions (#4066) --- frontend/src/components/VMediaInfo/VCopyLicense.vue | 8 ++++---- frontend/src/utils/attribution-html.ts | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/VMediaInfo/VCopyLicense.vue b/frontend/src/components/VMediaInfo/VCopyLicense.vue index 7c7acd59a2b..66be71afd3a 100644 --- a/frontend/src/components/VMediaInfo/VCopyLicense.vue +++ b/frontend/src/components/VMediaInfo/VCopyLicense.vue @@ -28,16 +28,16 @@ :media-id="media.id" :media-type="media.frontendMediaType" > -

- {{ getAttributionMarkup() }} -

+ + +

{{ getAttributionMarkup() }}

- {{ getAttributionMarkup({ isPlaintext: true }) }} +

{{ getAttributionMarkup({ isPlaintext: true }) }}

diff --git a/frontend/src/utils/attribution-html.ts b/frontend/src/utils/attribution-html.ts index d40f72e4bd3..106d3b67b61 100644 --- a/frontend/src/utils/attribution-html.ts +++ b/frontend/src/utils/attribution-html.ts @@ -244,7 +244,9 @@ export const getAttribution = ( }) } - const attribution = tFn("text", attributionParts).replace(/\s{2}/g, " ") + const attribution = tFn("text", attributionParts) + .replace(/\s{2}/g, " ") + .trim() return isPlaintext ? attribution