mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[PR #1404] [MERGED] allow newlines in in-line go templates #1595
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#1595
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/binwiederhier/ntfy/pull/1404
Author: @wunter8
Created: 7/27/2025
Status: ✅ Merged
Merged: 7/27/2025
Merged by: @binwiederhier
Base:
main← Head:inline-template-newlines📝 Commits (1)
0d36ab8allow newlines in in-line go templates📊 Changes
2 files changed (+64 additions, -3 deletions)
View changed files
📝
server/server.go(+9 -3)📝
server/server_test.go(+55 -0)📄 Description
Before the changes in this PR, there was a difference between
in a template YAML file and
in an inline template (in a URL/header param).
The inline template version would break (be considered an invalid template), because we were replacing all "\n" in the message field with literal newlines, making the template look like this:
Doing that before we rendered the template caused problems. This changes the code so that when an inline template is being used, we don't replace "\n" with literal newlines until after the template is rendered.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.