Skip to content
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

Fix: Abnormal strings appear when comments are saved after editing #29991

Merged
merged 3 commits into from Mar 22, 2024

Conversation

HEREYUA
Copy link
Contributor

@HEREYUA HEREYUA commented Mar 22, 2024

Partially resolved(The second problem): #29986

Before
HTML strings appear when comments are saved after editing

image

After

2024-03-22.14.02.58.mov

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 22, 2024
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 22, 2024
@HEREYUA HEREYUA marked this pull request as draft March 22, 2024 07:28
@HEREYUA HEREYUA changed the title Fix: Abnormal strings appear when reviews are saved after editing Fix: Abnormal strings appear when comments are saved after editing Mar 22, 2024
@HEREYUA HEREYUA marked this pull request as ready for review March 22, 2024 08:01
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 22, 2024
@lunny
Copy link
Member

lunny commented Mar 22, 2024

image I don't know whether it's realted.

@yardenshoham
Copy link
Member

I don't think so, how to reproduce?

@lunny
Copy link
Member

lunny commented Mar 22, 2024

I cannot reproduce it any more.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 22, 2024
@yardenshoham yardenshoham added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 22, 2024
@silverwind
Copy link
Member

silverwind commented Mar 22, 2024

image I don't know whether it's realted.

This is either web_src/js/features/repo-legacy.js:354 or web_src/js/features/repo-legacy.js:391 and likely a separate issue.

@@ -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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous code had a .dropzone-attachments class, it it no longer needed to be created, @yardenshoham?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's immediately replaced...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see the previous code created and appended it, but then immediately replaced it with the HTML string, so likely it's okay.

@silverwind silverwind added reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. and removed reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. labels Mar 22, 2024
@silverwind silverwind enabled auto-merge (squash) March 22, 2024 10:41
@yardenshoham yardenshoham added reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. and removed reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. labels Mar 22, 2024
@silverwind silverwind merged commit bf34723 into go-gitea:main Mar 22, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.23.0 milestone Mar 22, 2024
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 22, 2024
@6543 6543 modified the milestones: 1.23.0, 1.22.0 Mar 24, 2024
@yardenshoham yardenshoham added backport/v1.22 This PR should be backported to Gitea 1.22 and removed backport/v1.22 This PR should be backported to Gitea 1.22 labels Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/js size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants