From edc586d9bb290296110db357716fa3691585356a Mon Sep 17 00:00:00 2001 From: gitea-bot Date: Sat, 11 Jul 2026 18:30:34 +0000 Subject: [PATCH] Port templates to NodeBB 4.14 benchpress escaping (#19) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NodeBB 4.14 turned on real HTML escaping for single-brace template interpolations (4.13 used an identity escape). This ports raw-HTML output to the double-brace forms ({{helper(...)}}, {{txEscape(content)}}, {{tx(name)}}), mirroring the harmony 2.2.72 -> 3.0.15 and core 4.13.2 -> 4.14.0 template diffs. Fixes the escaped-markup breakage on westgate.pw after the 2026.07.11-1 deploy. Verified on a fresh 4.14.0 dev stack: no escaped tags on /, /categories, /category/2, /topic/1, /search; contract tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: vickydotbat Reviewed-on: https://git.westgate.pw/ShadowsOverWestgate/sow-nodebb-theme/pulls/19 Reviewed-by: xtul Co-authored-by: gitea-bot Co-committed-by: gitea-bot --- templates/category.tpl | 6 +++--- templates/emails/digest.tpl | 8 ++++---- templates/emails/notification.tpl | 2 +- templates/emails/partials/post-queue-body.tpl | 14 +++++++------- templates/header.tpl | 6 +++--- templates/partials/categories/children.tpl | 2 +- templates/partials/categories/item.tpl | 4 ++-- templates/partials/categories/lastpost.tpl | 4 ++-- .../category/selector-dropdown-content.tpl | 8 ++++---- templates/partials/header/topbar.tpl | 10 +++++----- templates/partials/posts_list_item.tpl | 6 +++--- templates/partials/quick-search-results.tpl | 2 +- templates/partials/search-results.tpl | 2 +- templates/partials/topics_list.tpl | 12 ++++++------ 14 files changed, 43 insertions(+), 43 deletions(-) diff --git a/templates/category.tpl b/templates/category.tpl index 10c27fa..d53c030 100644 --- a/templates/category.tpl +++ b/templates/category.tpl @@ -6,10 +6,10 @@
- {buildCategoryIcon(@value, "60px", "rounded-1")} + {{buildCategoryIcon(@value, "60px", "rounded-1")}}
-

{./name}

+

{{tx(./name)}}

{humanReadableNumber(totalTopicCount)} @@ -33,7 +33,7 @@
{{{ if ./descriptionParsed }}}
- {./descriptionParsed} + {{./descriptionParsed}}
{{{ end }}} {{{ if ./handleFull }}} diff --git a/templates/emails/digest.tpl b/templates/emails/digest.tpl index b9c1a64..19e46be 100644 --- a/templates/emails/digest.tpl +++ b/templates/emails/digest.tpl @@ -34,7 +34,7 @@ {{{ end }}} -

{notifications.bodyShort}

+

{{notifications.bodyShort}}

@@ -73,7 +73,7 @@
  • - +
    {renderDigestAvatar(@value)}{{renderDigestAvatar(@value)}}

    {topTopics.title}

    {topTopics.teaser.user.displayname}

    @@ -108,7 +108,7 @@
  • - +
    {renderDigestAvatar(@value)}{{renderDigestAvatar(@value)}}

    {popularTopics.title}

    {popularTopics.teaser.user.displayname}

    @@ -143,7 +143,7 @@
  • - + diff --git a/templates/emails/partials/post-queue-body.tpl b/templates/emails/partials/post-queue-body.tpl index c95df5d..420e69b 100644 --- a/templates/emails/partials/post-queue-body.tpl +++ b/templates/emails/partials/post-queue-body.tpl @@ -1,18 +1,18 @@

    [[post-queue:category]]

    -

    {category.name}

    +

    {{tx(notification.category.name)}}

    {{{ if topic.tid }}}[[post-queue:topic]]{{{ else }}}[[post-queue:title]]{{{ + >{{{ if notification.topic.tid }}}[[post-queue:topic]]{{{ else }}}[[post-queue:title]]{{{ end }}}

    - {{{ if topic.url }}}{topic.title}{{{ else - }}}{topic.title}{{{ end }}} + {{{ if notification.topic.url }}}{notification.topic.title}{{{ else + }}}{notification.topic.title}{{{ end }}}

    [[post-queue:user]]

    - {{{ if user.url }}}{user.username}{{{ else - }}}{user.username}{{{ end }}} + {{{ if notification.user.url }}}{notification.user.username}{{{ else + }}}{notification.user.username}{{{ end }}}

    -

    {content}

    +

    {{txEscape(notification.content)}}

    diff --git a/templates/header.tpl b/templates/header.tpl index 83fe707..5844f1b 100644 --- a/templates/header.tpl +++ b/templates/header.tpl @@ -1,10 +1,10 @@ - +{browserTitle} - {{{each metaTags}}}{function.buildMetaTag}{{{end}}} + {{{each metaTags}}}{{buildMetaTag(@value)}}{{{end}}} - {{{each linkTags}}}{function.buildLinkTag}{{{end}}} + {{{each linkTags}}}{{buildLinkTag(@value)}}{{{end}}}
    {renderDigestAvatar(@value)}{{renderDigestAvatar(@value)}}

    {recent.title}

    {recent.teaser.user.displayname}

    diff --git a/templates/emails/notification.tpl b/templates/emails/notification.tpl index ea85b3a..af3ca54 100644 --- a/templates/emails/notification.tpl +++ b/templates/emails/notification.tpl @@ -20,7 +20,7 @@

    -{body} +{{txEscape(body)}}