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>
This commit is contained in:
parent
706244925d
commit
ccbc4cffaa
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue