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

@ -16,7 +16,7 @@ RSpec.describe Onebox::Engine::GithubIssueOnebox do
describe "#to_html" do
it "sanitizes the input and transform the emoji into an img tag" do
sanitized_label =
'Test <img src="/images/emoji/twitter/+1.png?v=12" title="+1" class="emoji" alt="+1" loading="lazy" width="20" height="20"> &lt;style&gt;body {display: none}&lt;/style&gt;'
'Test <img src="/images/emoji/twitter/+1.png?v=12" title="+1" class="emoji" alt="+1" loading="lazy" width="20" height="20">'
expect(html).to include(sanitized_label)
end