Skip to content

Fix no-content message not rendering after comment edit#36733

Merged
lunny merged 3 commits intogo-gitea:mainfrom
silverwind:nocontent1
Feb 27, 2026
Merged

Fix no-content message not rendering after comment edit#36733
lunny merged 3 commits intogo-gitea:mainfrom
silverwind:nocontent1

Conversation

@silverwind
Copy link
Copy Markdown
Member

@silverwind silverwind commented Feb 24, 2026

When non-empty comment content edited is deleted, it would render a empty comment body:

image

Fix it so it renders the same placeholder HTML that the server sends for empty content before edits:

image

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 24, 2026
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Feb 24, 2026
@silverwind silverwind changed the title Fix no-content message not rendering after comment edit Fix no-content message not rendering after comment edit Feb 24, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where editing a non-empty comment/issue content to become empty would render a blank comment body instead of showing the "No content" placeholder that the server initially renders for empty content.

Changes:

  • Extracted duplicate empty content handling logic into a new commentContentHTML helper function
  • Applied this helper consistently to both issue content and comment content updates

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
routers/web/repo/issue_comment.go Removed duplicate empty content handling code and unused imports; now calls commentContentHTML helper
routers/web/repo/issue.go Added new commentContentHTML helper function; applied it to UpdateIssueContent response

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@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 Feb 24, 2026
@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 Feb 27, 2026
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 27, 2026
@lunny lunny enabled auto-merge (squash) February 27, 2026 22:20
@lunny lunny merged commit 2e00b2f into go-gitea:main Feb 27, 2026
26 checks passed
@GiteaBot GiteaBot added this to the 1.26.0 milestone Feb 27, 2026
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 27, 2026
@silverwind silverwind deleted the nocontent1 branch February 28, 2026 07:27
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 2, 2026
* giteaofficial/main: (21 commits)
  Enable docker layer caching for `dry-run` and `nightly` container builds (go-gitea#36738)
  Add admin badge to navbar avatar (go-gitea#36790)
  WorkflowDispatch api optionally return runid (go-gitea#36706)
  upgrade minimatch (go-gitea#36760)
  Add `never` option to `PUBLIC_URL_DETECTION` configuration (go-gitea#36785)
  Refactor avatar package, support default avatar fallback (go-gitea#36788)
  Mark unused&immature activitypub as "not implemented" (go-gitea#36789)
  Add “Copy Source” to markup comment menu (go-gitea#36726)
  Update Nix flake (go-gitea#36787)
  Implements OIDC RP-Initiated Logout (go-gitea#36724)
  Fix README symlink resolution in subdirectories like .github (go-gitea#36775)
  [skip ci] Updated translations via Crowdin
  Correct spelling (go-gitea#36783)
  refactor: replace legacy tw-flex utility classes with flex-text-block/inline (go-gitea#36778)
  Fix `no-content` message not rendering after comment edit (go-gitea#36733)
  Fix typos and grammar in English locale (go-gitea#36751)
  Move Fomantic dropdown CSS to custom module (go-gitea#36530)
  Use "Enable Gravatar" but not "Disable" (go-gitea#36771)
  feat: add branch_count to repository API (go-gitea#35351) (go-gitea#36743)
  Deprecate RenderWithErr (go-gitea#36769)
  ...
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/go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants