[pbs-devel] [PATCH proxmox-backup 1/2] notifications: templates: adapt to whitespace handling changes with new handlebars version

Lukas Wagner l.wagner at proxmox.com
Tue Aug 5 15:35:54 CEST 2025


Handlebars 4.1 changed how whitespace is trimmed when using the `~`
operator in helpers/variables in order to be closer to the canonical
JavaScript handlebars implementation. These changed impacted how some of
our notification templates were rendered. This commit aims to restore
the initial appearance.

[1] https://github.com/sunng87/handlebars-rust

Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
 templates/default/package-updates-body.txt.hbs |  2 +-
 templates/default/sync-err-body.txt.hbs        |  1 +
 templates/default/sync-ok-body.txt.hbs         |  1 +
 templates/default/tape-backup-err-body.txt.hbs | 17 ++++++++++-------
 templates/default/tape-backup-ok-body.txt.hbs  | 16 +++++++++-------
 templates/default/verify-err-body.txt.hbs      |  2 +-
 6 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/templates/default/package-updates-body.txt.hbs b/templates/default/package-updates-body.txt.hbs
index cf69ae694..9800ab5ca 100644
--- a/templates/default/package-updates-body.txt.hbs
+++ b/templates/default/package-updates-body.txt.hbs
@@ -1,6 +1,6 @@
 Proxmox Backup Server has the following updates available:
 {{#each available-updates}}
-    {{this.package-name}}: {{this.installed-version}} -> {{this.available-version~}}
+    {{this.package-name}}: {{this.installed-version}} -> {{this.available-version}}
 {{/each}}
 
 To upgrade visit the web interface:
diff --git a/templates/default/sync-err-body.txt.hbs b/templates/default/sync-err-body.txt.hbs
index d47a5d6c8..85b829976 100644
--- a/templates/default/sync-err-body.txt.hbs
+++ b/templates/default/sync-err-body.txt.hbs
@@ -6,6 +6,7 @@ Remote Store:       {{remote-datastore}}
 {{else~}}
 Local Source Store: {{remote-datastore}}
 {{/if}}
+
 Synchronization failed: {{error}}
 
 
diff --git a/templates/default/sync-ok-body.txt.hbs b/templates/default/sync-ok-body.txt.hbs
index 6ef5993de..aba8c9961 100644
--- a/templates/default/sync-ok-body.txt.hbs
+++ b/templates/default/sync-ok-body.txt.hbs
@@ -6,6 +6,7 @@ Remote Store:       {{remote-datastore}}
 {{else~}}
 Local Source Store: {{remote-datastore}}
 {{/if}}
+
 Synchronization successful.
 
 
diff --git a/templates/default/tape-backup-err-body.txt.hbs b/templates/default/tape-backup-err-body.txt.hbs
index 387b2438a..7e6203db7 100644
--- a/templates/default/tape-backup-err-body.txt.hbs
+++ b/templates/default/tape-backup-err-body.txt.hbs
@@ -5,18 +5,21 @@ Datastore:  {{datastore}}
 Tape Pool:  {{tape-pool}}
 Tape Drive: {{tape-drive}}
 
-{{#if snapshot-list~}}
+{{#if snapshot-list}}
 Snapshots included:
+{{#each snapshot-list}}
+  {{this}}
+{{/each}}
 
-{{#each snapshot-list~}}
-{{this}}
-{{/each~}}
 {{/if}}
+Duration: {{duration job-duration}}
+
 {{#if used-tapes-list}}
 Used Tapes:
-{{#each used-tapes-list~}}
-{{this}}
-{{/each~}}
+{{#each used-tapes-list}}
+  {{this}}
+{{/each}}
+
 {{/if}}
 Tape Backup failed: {{error}}
 
diff --git a/templates/default/tape-backup-ok-body.txt.hbs b/templates/default/tape-backup-ok-body.txt.hbs
index 33364142a..6c03e49d4 100644
--- a/templates/default/tape-backup-ok-body.txt.hbs
+++ b/templates/default/tape-backup-ok-body.txt.hbs
@@ -5,19 +5,21 @@ Datastore:  {{datastore}}
 Tape Pool:  {{tape-pool}}
 Tape Drive: {{tape-drive}}
 
-{{#if snapshot-list~}}
+{{#if snapshot-list}}
 Snapshots included:
+{{#each snapshot-list}}
+  {{this}}
+{{/each}}
 
-{{#each snapshot-list~}}
-{{this}}
-{{/each~}}
 {{/if}}
 Duration: {{duration job-duration}}
+
 {{#if used-tapes-list}}
 Used Tapes:
-{{#each used-tapes-list~}}
-{{this}}
-{{/each~}}
+{{#each used-tapes-list}}
+  {{this}}
+{{/each}}
+
 {{/if}}
 Tape Backup successful.
 
diff --git a/templates/default/verify-err-body.txt.hbs b/templates/default/verify-err-body.txt.hbs
index 96922eee1..1eb63206a 100644
--- a/templates/default/verify-err-body.txt.hbs
+++ b/templates/default/verify-err-body.txt.hbs
@@ -5,7 +5,7 @@ Datastore: {{datastore}}
 Verification failed on these snapshots/groups:
 
 {{#each failed-snapshot-list}}
-    {{this~}}
+    {{this}}
 {{/each}}
 
 
-- 
2.47.2





More information about the pbs-devel mailing list