-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Breaking summary for template refactoring #29395
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wxiaoguang
added
the
pr/breaking
Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it!
label
Feb 25, 2024
GiteaBot
added
the
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
label
Feb 25, 2024
pull-request-size
bot
added
the
size/XS
Denotes a PR that changes 0-9 lines, ignoring generated files.
label
Feb 25, 2024
Why WIP? |
And isn't this PR the opposite of |
Because it (the refactoring) hasn't finished yet ..... |
wxiaoguang
force-pushed
the
breaking-template
branch
from
March 1, 2024 10:27
0043652
to
28d5420
Compare
wxiaoguang
force-pushed
the
breaking-template
branch
from
March 1, 2024 10:36
28d5420
to
773c9cc
Compare
pull-request-size
bot
added
size/M
Denotes a PR that changes 30-99 lines, ignoring generated files.
and removed
size/XS
Denotes a PR that changes 0-9 lines, ignoring generated files.
labels
Mar 1, 2024
wxiaoguang
changed the title
WIP: Breaking summary for template refactoring
Breaking summary for template refactoring
Mar 1, 2024
Ready now. |
lunny
reviewed
Mar 1, 2024
wxiaoguang
force-pushed
the
breaking-template
branch
from
March 1, 2024 14:33
f626da6
to
d2d1314
Compare
lunny
approved these changes
Mar 2, 2024
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 2, 2024
appleboy
approved these changes
Mar 3, 2024
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 3, 2024
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Mar 3, 2024
* upstream/main: Breaking summary for template refactoring (go-gitea#29395) [skip ci] Updated translations via Crowdin Fix incorrect cookie path for AppSubURL (go-gitea#29534) gitea.service: Remove syslog.target (go-gitea#29550) Add option to set language in admin user view (go-gitea#28449) Fix elipsis button not working if the last commit loading is deferred (go-gitea#29544) Fix incorrect relative/absolute URL usages (go-gitea#29531) Add support for API blob upload of release attachments (go-gitea#29507) Fix queue worker incorrectly stopped when there are still more items in the queue (go-gitea#29532) remove util.OptionalBool and related functions (go-gitea#29513) Rename Action.GetDisplayName to GetActDisplayName (go-gitea#29540) Make PR form use toast to show error message (go-gitea#29545)
DennisRasey
pushed a commit
to DennisRasey/forgejo
that referenced
this pull request
Mar 6, 2024
go-gitea/gitea#29395 (cherry picked from commit e71b69257c38178eed9ccd0b62a5ae47d67858d4)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
modifies/docs
pr/breaking
Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it!
size/M
Denotes a PR that changes 30-99 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a summary PR for the breakings of template refactoring, because there are many related PRs.
In Gitea 1.22, there are a lot of template related refactoring changes. The main purpose of these changes is to make Gitea's template system easier to use and more safe.
Safe
is renamed toSafeHTML
, and in most cases it shouldn't be used.Escape
is renamed toHTMLEscape
, and in most cases it shouldn't be used. The template should escape most variables automatically.Str2html
is renamed toSanitizeHTML
, only use it when necessary, it only "sanitizes" the input by pre-defined rules, but it doesn't "render" or "convert" the content.HTMLFormat
instead ofprintf
when processing HTML related contents.If you are using custom templates (including "mail" templates and "website" templates), after you upgrade to Gitea 1.22, you should extract the templates from Gitea and apply your changes with these new approaches. Keeping using the old custom templates would cause various problems (500 error, mail errors, double-escaping, etc)