Add Youtube embeds

This will embed a youtube video inline on the page. Hopefully it works!

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-07-29 19:59:10 -07:00
parent b7cc4c5681
commit b84ca6d84f
4 changed files with 56 additions and 3 deletions

View File

@@ -103,3 +103,15 @@ what happened to the 1 2 3 4 5 6 7 8 9
for input, output in expected:
rb = ReplyBuilder(input.strip(), parse_spoilers=True)
self.assertEquals(rb.build(), output)
def test_youtube_embed(self):
expected = [
(
"https://www.youtube.com/watch?v=O_3_-UrhZH0",
'<span class="youtube_embed"><span class="youtube_embed_container">https://www.youtube.com/watch?v=O_3_-UrhZH0 [<a class="youtube_embed_link" data-yt-hash="O_3_-UrhZH0" href="https://www.youtube.com/watch?v=O_3_-UrhZH0">Embed</a>]</span></span>',
),
]
for input, output in expected:
rb = ReplyBuilder(input.strip())
self.assertEquals(rb.build(), output)