From 901ae1ddd11f567eab9838e4b7fe82f73d87befb Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 1 Oct 2020 10:38:44 -0400 Subject: [PATCH] FIX: Allow staff to use HTML in the category read only banner --- .../app/templates/components/category-read-only-banner.hbs | 2 +- test/javascripts/acceptance/category-banner-test.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/app/templates/components/category-read-only-banner.hbs b/app/assets/javascripts/discourse/app/templates/components/category-read-only-banner.hbs index 4c00dc80445..902d051eb0d 100644 --- a/app/assets/javascripts/discourse/app/templates/components/category-read-only-banner.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/category-read-only-banner.hbs @@ -1,7 +1,7 @@ {{#if shouldShow}}
- {{category.read_only_banner}} + {{html-safe category.read_only_banner}}
{{/if}} diff --git a/test/javascripts/acceptance/category-banner-test.js b/test/javascripts/acceptance/category-banner-test.js index ea51c986a3f..8962b68c7bb 100644 --- a/test/javascripts/acceptance/category-banner-test.js +++ b/test/javascripts/acceptance/category-banner-test.js @@ -29,7 +29,7 @@ acceptance("Category Banners", { slug: "test-read-only-with-banner", permission: null, read_only_banner: - "You need to video yourself doing the secret handshake to post here", + "You need to video yourself
doing
the secret handshake to post here", }, ], }, @@ -55,6 +55,10 @@ QUnit.test("Displays category banners when set", async (assert) => { await click(".modal-footer>.btn-primary"); assert.ok(!visible(".bootbox.modal"), "it closes the modal"); assert.ok(visible(".category-read-only-banner"), "it shows a banner"); + assert.ok( + find(".category-read-only-banner .inner").length === 1, + "it allows staff to embed html in the message" + ); }); acceptance("Anonymous Category Banners", {