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

Refactor markup render system #32612

Merged
merged 5 commits into from
Nov 24, 2024
Merged

Conversation

wxiaoguang
Copy link
Contributor

@wxiaoguang wxiaoguang commented Nov 22, 2024

This PR removes (almost) all path tricks, and introduces "renderhelper" package.

Now we can clearly see the rendering behaviors for comment/file/wiki, more details are in "renderhelper" tests.

Fix #31411 , fix #18592, fix #25632 and maybe more problems. (ps: fix #32608 by the way)

@wxiaoguang wxiaoguang added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Nov 22, 2024
@wxiaoguang wxiaoguang added this to the 1.23.0 milestone Nov 22, 2024
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 22, 2024
@wxiaoguang wxiaoguang marked this pull request as draft November 22, 2024 11:02
@pull-request-size pull-request-size bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Nov 22, 2024
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels Nov 22, 2024
@wxiaoguang wxiaoguang force-pushed the refacor-markup branch 7 times, most recently from e337c5f to adf30d8 Compare November 22, 2024 14:32
@wxiaoguang wxiaoguang marked this pull request as ready for review November 22, 2024 14:37
@wxiaoguang wxiaoguang force-pushed the refacor-markup branch 2 times, most recently from 2791c06 to 052867a Compare November 22, 2024 14:50
@wxiaoguang wxiaoguang force-pushed the refacor-markup branch 4 times, most recently from 40ec58c to 9c198a3 Compare November 23, 2024 00:38
@lunny
Copy link
Member

lunny commented Nov 23, 2024

Move the render under models seems wired. Since only repo_model.Repository has been dependent. Maybe we can create a repository interface and move these render codes to modules/renderer package? We can also extend gitrepo.Repository interface to have more methods.

@wxiaoguang
Copy link
Contributor Author

wxiaoguang commented Nov 23, 2024

Move the render under models seems wired. Since only repo_model.Repository has been dependent. Maybe we can create a repository interface and move these render codes to modules/renderer package? We can also extend gitrepo.Repository interface to have more methods.

There are enough comments, that's the only choice due to the legacy problematic code structure. Otherwise there will be much more unnecessary changes in this PR.

image

modules/markup/html_test.go Outdated Show resolved Hide resolved
@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 Nov 23, 2024
@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 Nov 24, 2024
@wxiaoguang wxiaoguang merged commit 633785a into go-gitea:main Nov 24, 2024
26 checks passed
@wxiaoguang wxiaoguang deleted the refacor-markup branch November 24, 2024 08:19
zjjhot added a commit to zjjhot/gitea that referenced this pull request Nov 24, 2024
* giteaofficial/main:
  Refactor markup render system (go-gitea#32612)
  Add vue-tsc (go-gitea#32601)
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/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
4 participants