diff options
author | HEREYUA <37935145+HEREYUA@users.noreply.github.com> | 2024-03-22 12:22:36 +0100 |
---|---|---|
committer | Earl Warren <contact@earl-warren.org> | 2024-03-26 19:04:27 +0100 |
commit | 9cf4ab033818c01eeaa0fe7ac11d07519697fdcb (patch) | |
tree | 0df752e7cce62e6ca567cab93513d50eaf1ce0d2 /web_src/js/features/repo-legacy.js | |
parent | Fix some pending problems (#29985) (diff) | |
download | forgejo-9cf4ab033818c01eeaa0fe7ac11d07519697fdcb.tar.xz forgejo-9cf4ab033818c01eeaa0fe7ac11d07519697fdcb.zip |
Fix: Abnormal strings appear when comments are saved after editing (#29991)
Partially resolved(The second problem):
[#29986](https://github.com/go-gitea/gitea/issues/29986)
**Before**
HTML strings appear when comments are saved after editing
![image](https://github.com/go-gitea/gitea/assets/37935145/c356d99a-8473-4cc5-8e38-1b207ccd8b12)
**After**
https://github.com/go-gitea/gitea/assets/37935145/525601f9-3ee1-4266-9105-36d82b91b1c8
(cherry picked from commit bf34723491dcbb45dee7888c574e295cae6096be)
Diffstat (limited to '')
-rw-r--r-- | web_src/js/features/repo-legacy.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/web_src/js/features/repo-legacy.js b/web_src/js/features/repo-legacy.js index 11bb758187..33d8ab2918 100644 --- a/web_src/js/features/repo-legacy.js +++ b/web_src/js/features/repo-legacy.js @@ -436,7 +436,7 @@ async function onEditContent(event) { const $content = $segment; if (!$content.find('.dropzone-attachments').length) { if (data.attachments !== '') { - $content[0].append(data.attachments); + $content[0].insertAdjacentHTML('beforeend', data.attachments); } } else if (data.attachments === '') { $content.find('.dropzone-attachments').remove(); |