mirror of https://github.com/zulip/zulip.git
Wrap youtube_re.
This commit is contained in:
parent
c25c8d8c98
commit
ce7c7d3510
|
@ -338,7 +338,8 @@ class InlineInterestingLinkProcessor(markdown.treeprocessors.Treeprocessor):
|
|||
return None
|
||||
# Youtube video id extraction regular expression from http://pastebin.com/KyKAFv1s
|
||||
# If it matches, match.group(2) is the video id.
|
||||
youtube_re = r'^((?:https?://)?(?:youtu\.be/|(?:\w+\.)?youtube(?:-nocookie)?\.com/)(?:(?:(?:v|embed)/)|(?:(?:watch(?:_popup)?(?:\.php)?)?(?:\?|#!?)(?:.+&)?v=)))?([0-9A-Za-z_-]+)(?(1).+)?$'
|
||||
youtube_re = r'^((?:https?://)?(?:youtu\.be/|(?:\w+\.)?youtube(?:-nocookie)?\.com/)' + \
|
||||
r'(?:(?:(?:v|embed)/)|(?:(?:watch(?:_popup)?(?:\.php)?)?(?:\?|#!?)(?:.+&)?v=)))?([0-9A-Za-z_-]+)(?(1).+)?$'
|
||||
match = re.match(youtube_re, url)
|
||||
if match is None:
|
||||
return None
|
||||
|
|
Loading…
Reference in New Issue