-
Notifications
You must be signed in to change notification settings - Fork 1
Display any HTML in the "alert_message" setting #1311
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Allows the alert_message configuration value to render trusted raw HTML (e.g.,
, ) in the shutdown banner.
- Added a template helper (displayAsRawHTML) returning template.HTML and registered it with Gin.
- Updated alert.html to pipe AlertMessage through the new helper for unescaped rendering.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| home/main.go | Adds displayAsRawHTML helper and registers it in the Gin template func map. |
| home/templates/alert.html | Uses the new helper to render the configured alert message as raw HTML. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
The latest shutdown banner needed some HTML formatting to enable <br> and <a> tags. The easiest way forward is to allow raw HTML in that config file. This should be safe, as we control the settings.
44608a2 to
b75ad48
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
mollybsmith-noaa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
The latest shutdown banner needed some HTML formatting to enable
<br>and<a>tags. The easiest way forward is to allow raw HTML in that config file. This should be safe, as we control the settings.