FIX: Allow sanitized-HTML in GH issues and categories oneboxes. (#25374)

Follow-up to d78357917c

Related meta topic: https://meta.discourse.org/t/html-is-not-render-on-category-onebox-description/289424:
This commit is contained in:
Roman Rizzi
2024-01-22 15:25:29 -03:00
committed by GitHub
parent a37d26f559
commit a709b7e861
4 changed files with 7 additions and 4 deletions

View File

@ -40,7 +40,10 @@ module Onebox
body, excerpt = compute_body(raw["body"])
ulink = URI(link)
labels = raw["labels"].map { |l| { name: Emoji.codes_to_img(CGI.escapeHTML(l["name"])) } }
labels =
raw["labels"].map do |l|
{ name: Emoji.codes_to_img(Onebox::Helpers.sanitize(l["name"])) }
end
{
link: @url,