FIX: do not escape slash for category text description (#20460)

Original solution to use `description` instead of `text_description` was wrong: https://github.com/discourse/discourse/pull/20436

Problem is that we have to escape HTML tags.

However, we would like to use escape method which is keep `/` intact.   Expected behavior is given by  ERB::Util.html_escape instead of Rack::Utils.escape_html

/t/92015
This commit is contained in:
Krzysztof Kotlarek
2023-02-27 12:48:48 +11:00
committed by GitHub
parent 52d4de7b45
commit d92fd30d23
5 changed files with 6 additions and 6 deletions

View File

@ -18,6 +18,6 @@ RSpec.describe CategoryBadge do
c = Fabricate(:category, description: '<code>\' &lt;b id="x"&gt;</code>')
html = CategoryBadge.html_for(c)
expect(html).to include("title='&#x27; &lt;b id=&quot;x&quot;&gt;'")
expect(html).to include("title='&#39; &lt;b id=&quot;x&quot;&gt;'")
end
end