-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Edit comment bug: can not save empty comment #29986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
…29991) Partially resolved(The second problem): [#29986](#29986) **Before** HTML strings appear when comments are saved after editing  **After** https://github.com/go-gitea/gitea/assets/37935145/525601f9-3ee1-4266-9105-36d82b91b1c8
@wxiaoguang should we remove
issue/critical
|
Oh yes, I just added it for remembering (to make sure it could be fixed in 1.22 milestone). It gets fixed pretty fast. Thank you. And I edited the description to make it clear. 😁 |
For the first one: "can not save empty comment" I think it could be considered as not a bug. I think it doesn't make sense to update to an empty content. Especially in some templates, it checks |
For the first one, actually what I want to say is that the JSON returns empty |
…29991) Partially resolved(The second problem): [#29986](go-gitea/gitea#29986) **Before** HTML strings appear when comments are saved after editing  **After** https://github.com/go-gitea/gitea/assets/37935145/525601f9-3ee1-4266-9105-36d82b91b1c8 (cherry picked from commit bf34723491dcbb45dee7888c574e295cae6096be)
I think we should do this (both UI and API):
|
A quick fix: Allow to save empty comment #30706 |
It seems that all of them will be finished after #30706 merged. |
Description
I think we need to check
oldContent == comment.Content
instead oflen(comment.Content) == 0
and return an empty json, then check
data.content === undefined
in js.(the second one has been fixed)
Caused by #29843


after the edition you will see this strange code:
If I revert the changes from #29843, it works
Have no idea how to fix this, as lint not allow using append.
maybe other changes in #29843 will also have this issue?
the appended data will be text not DOM element.
Gitea Version
latest
The text was updated successfully, but these errors were encountered: