enhance(frontend): ハッシュタグ入力時に、本文の末尾の行に何も書かれていない場合は新たにスペースを追加しないように (#12851)

* (enhance) ハッシュタグ入力時に、本文の末尾の行に何も書かれていないならスペースを追記しない

* Updahe Changelog
This commit is contained in:
かっこかり 2023-12-29 18:22:40 +09:00 committed by GitHub
parent 7ca0af9e7e
commit 8fb8d7c10c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -12,6 +12,11 @@
-->
## 202x.x.x (Unreleased)
### Client
- Enhance: ハッシュタグ入力時に、本文の末尾の行に何も書かれていない場合は新たにスペースを追加しないように
## 2023.12.2
### General

View File

@ -752,7 +752,17 @@ async function post(ev?: MouseEvent) {
if (withHashtags.value && hashtags.value && hashtags.value.trim() !== '') {
const hashtags_ = hashtags.value.trim().split(' ').map(x => x.startsWith('#') ? x : '#' + x).join(' ');
postData.text = postData.text ? `${postData.text} ${hashtags_}` : hashtags_;
if (!postData.text) {
postData.text = hashtags_;
} else {
const postTextLines = postData.text.split('\n');
if (postTextLines[postTextLines.length - 1].trim() === '') {
postTextLines[postTextLines.length - 1] += hashtags_;
} else {
postTextLines[postTextLines.length - 1] += ' ' + hashtags_;
}
postData.text = postTextLines.join('\n');
}
}
// plugin