mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
DEV: Add test.
Follow-up to bccd090cedd4f49b9a07958292baed462b8c1a1c.
This commit is contained in:
@ -41,4 +41,16 @@ describe PrettyText do
|
|||||||
expect(md).to eq(html)
|
expect(md).to eq(html)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'escapes summary text' do
|
||||||
|
md = PrettyText.cook(<<~EOF)
|
||||||
|
<script>alert('hello')</script>
|
||||||
|
[details="<script>alert('hello')</script>"]
|
||||||
|
<script>alert('hello')</script>
|
||||||
|
[/details]
|
||||||
|
EOF
|
||||||
|
md = PrettyText.format_for_email(md, post)
|
||||||
|
|
||||||
|
expect(md).not_to include('<script>')
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user