From ccbc4cffaa8bc8b83288a9f74e3efbafa70dca09 Mon Sep 17 00:00:00 2001 From: tamaina Date: Thu, 3 Jul 2025 18:00:43 +0900 Subject: [PATCH] =?UTF-8?q?enhance(frontend):=20=E5=85=B1=E6=9C=89?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=A7=E3=80=81title=E3=81=A8text?= =?UTF-8?q?=E3=81=AB=E5=90=8C=E3=81=98=E5=86=85=E5=AE=B9=E3=81=8C=E5=85=A5?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E9=9A=9B=E3=81=AE=E5=89=8A?= =?UTF-8?q?=E9=99=A4=E3=83=AD=E3=82=B8=E3=83=83=E3=82=AF=E3=82=92=E5=BC=B7?= =?UTF-8?q?=E5=8C=96=20=20(#16226)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * enhance(frontend): 共有ページで、titleとtextに同じ内容が入っていた際の削除ロジックを強化 Fix #16224 * fix * +→* * fix * use RegExp.test * Update packages/frontend/src/pages/share.vue Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com> --------- Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com> --- packages/frontend/src/pages/share.vue | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/pages/share.vue b/packages/frontend/src/pages/share.vue index 71f572657b..51ac9d66f0 100644 --- a/packages/frontend/src/pages/share.vue +++ b/packages/frontend/src/pages/share.vue @@ -59,10 +59,21 @@ const visibleUsers = ref([] as Misskey.entities.UserDetailed[]); async function init() { let noteText = ''; - if (title.value) noteText += `[ ${title.value} ]\n`; - // Googleニュース対策 - if (text?.startsWith(`${title.value}.\n`)) noteText += text.replace(`${title.value}.\n`, ''); - else if (text && title.value !== text) noteText += `${text}\n`; + if (title.value) { + noteText += `[ ${title.value} ]\n`; + + //#region add text to note text + if (text?.startsWith(title.value)) { + // For the Google app https://github.com/misskey-dev/misskey/issues/16224 + noteText += text.replace(title.value, '').trimStart(); + } else if (text) { + noteText += `${text}\n`; + } + //#endregion + } else if (text) { + noteText += `${text}\n`; + } + if (url) { try { // Normalize the URL to URL-encoded and puny-coded from with the URL constructor.