summaryrefslogtreecommitdiff
path: root/packages/frontend/src/pages/share.vue
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2025-07-03 18:00:43 +0900
committerGitHub <noreply@github.com>2025-07-03 18:00:43 +0900
commitccbc4cffaa8bc8b83288a9f74e3efbafa70dca09 (patch)
tree8f5d4421c5bf5c24ee085fb349413e6168174755 /packages/frontend/src/pages/share.vue
parentfix(frontend): 条件により保存できない場合のメッセージを... (diff)
downloadmisskey-ccbc4cffaa8bc8b83288a9f74e3efbafa70dca09.tar.gz
misskey-ccbc4cffaa8bc8b83288a9f74e3efbafa70dca09.tar.bz2
misskey-ccbc4cffaa8bc8b83288a9f74e3efbafa70dca09.zip
enhance(frontend): 共有ページで、titleとtextに同じ内容が入っていた際の削除ロジックを強化 (#16226)
* 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>
Diffstat (limited to 'packages/frontend/src/pages/share.vue')
-rw-r--r--packages/frontend/src/pages/share.vue19
1 files 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.