diff src/lib/Bbcode.luan @ 27:6871eec2cf4c

add rumble
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 21 Jul 2022 00:01:46 -0600
parents cdcd1b70c15e
children d9d7aa2a79db
line wrap: on
line diff
--- a/src/lib/Bbcode.luan	Wed Jul 20 15:47:18 2022 -0600
+++ b/src/lib/Bbcode.luan	Thu Jul 21 00:01:46 2022 -0600
@@ -104,6 +104,7 @@
 local youtube_ptn1 = [[https://youtu.be/([a-zA-Z0-9_-]+)(?:\?t=([0-9]+))?]]
 local youtube_ptn2 = [[https://www.youtube.com/watch\?v=([a-zA-Z0-9_-]+)(?:&t=([0-9]+)s)?]]
 local bitchute_ptn = [[https://www.bitchute.com/video/([a-zA-Z0-9]+)/]]
+local rumble_ptn = [[https://rumble.com/embed/[a-z0-9]+/\?pub=[a-z0-9]+]]
 
 function html.video(bbcode,options)
 	local url = bbcode.contents
@@ -124,6 +125,10 @@
 		%><iframe width="560" height="315" scrolling="no" frameborder="0" style="border: none;" src="https://www.bitchute.com/embed/<%=id%>/"></iframe><%
 		return
 	end
+	if matches(url,rumble_ptn) then
+		%><iframe width="560" height="315" frameborder="0" allowfullscreen src="<%=url%>"></iframe><%
+		return
+	end
 	url = html_encode(url)
 	%><a href="<%=url%>"><%=url%></a><%
 end