mirror of
https://github.com/frappe/lms.git
synced 2026-05-01 13:19:26 +03:00
fix: support youtube watch links as preview links
(cherry picked from commit f63a4a44a2)
This commit is contained in:
@@ -696,7 +696,6 @@ export const escapeHTML = (text) => {
|
||||
'"': '"',
|
||||
"'": ''',
|
||||
'`': '`',
|
||||
'=': '=',
|
||||
}
|
||||
|
||||
return String(text).replace(
|
||||
|
||||
@@ -47,7 +47,9 @@ class LMSCourse(Document):
|
||||
).save(ignore_permissions=True)
|
||||
|
||||
def validate_video_link(self):
|
||||
if self.video_link and "/" in self.video_link:
|
||||
if self.video_link and "watch?v=" in self.video_link:
|
||||
self.video_link = self.video_link.split("watch?v=")[-1]
|
||||
elif self.video_link and "/" in self.video_link:
|
||||
self.video_link = self.video_link.split("/")[-1]
|
||||
|
||||
def validate_status(self):
|
||||
|
||||
Reference in New Issue
Block a user