mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-04 00:44:10 -04:00
Unescape HTML entities in oEmbed titles. (#14781)
It doesn't seem valid that HTML entities should appear in the title field of oEmbed responses, but a popular WordPress plug-in seems to do it. There should not be harm in unescaping these.
This commit is contained in:
parent
7e582a25f8
commit
babeeb4e7a
3 changed files with 20 additions and 6 deletions
|
@ -150,3 +150,13 @@ class OEmbedTests(HomeserverTestCase):
|
|||
result = self.parse_response({"type": "link"})
|
||||
self.assertIn("og:type", result.open_graph_result)
|
||||
self.assertEqual(result.open_graph_result["og:type"], "website")
|
||||
|
||||
def test_title_html_entities(self) -> None:
|
||||
"""Test HTML entities in title"""
|
||||
result = self.parse_response(
|
||||
{"title": "Why JSON isn’t a Good Configuration Language"}
|
||||
)
|
||||
self.assertEqual(
|
||||
result.open_graph_result["og:title"],
|
||||
"Why JSON isn’t a Good Configuration Language",
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue