]> source.dussan.org Git - gitea.git/commitdiff
update ``.raw-content`` when edit issue/comment content (#16021)
authora1012112796 <1012112796@qq.com>
Tue, 1 Jun 2021 02:22:49 +0000 (10:22 +0800)
committerGitHub <noreply@github.com>
Tue, 1 Jun 2021 02:22:49 +0000 (22:22 -0400)
* update ``.raw-content`` when edit issue/comment content

fix #16000

Signed-off-by: a1012112796 <1012112796@qq.com>
* handle empty content

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
web_src/js/index.js

index 9f016ca84aba21b68990afa48775e9aff6e22871..8818511e32cf2fbda29e5e7bf4f985f955eb36a3 100644 (file)
@@ -1098,8 +1098,10 @@ async function initRepository() {
           }, (data) => {
             if (data.length === 0 || data.content.length === 0) {
               $renderContent.html($('#no-content').html());
+              $rawContent.text('');
             } else {
               $renderContent.html(data.content);
+              $rawContent.text($textarea.val());
             }
             const $content = $segment;
             if (!$content.find('.dropzone-attachments').length) {