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

feat!: sanitize theme footer's templates #442

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

mfontanini
Copy link
Owner

@mfontanini mfontanini commented Feb 7, 2025

This sanitizes the theme footer's template so that we have sure that it's not malformed and doesn't reference any variables that can't be used (e.g. {bar}). This now also avoids allocation a bunch of strings when rendering the footer, since every variable was being replaced via str::replace.

This is a breaking change for anyone who already has a malformed string in their string templates. If someone does use a string like {lord} George in their footer please bring it up and we can see what to do.

@mfontanini mfontanini merged commit fc5062e into master Feb 7, 2025
4 checks passed
@mfontanini mfontanini deleted the feat/sanitize-footer-template branch February 7, 2025 14:23
mfontanini added a commit that referenced this pull request Feb 28, 2025
After #442 you could no longer use braces unless it was to refer to a
variable. This PR softens that restriction by letting you use double
braces as an "escaped brace" to let you use them anywhere.

e.g. this footer "{title} {{potato}}" will render as "<title>
{{potato}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant