Vimeo embeds
parent
281f67c29c
commit
7942c872c4
|
@ -63,6 +63,11 @@ class Snipt(models.Model):
|
|||
self.stylized = self.stylized.replace('[[youtube-{}-{}x{}]]'.format(str(match[0]), str(match[1]), str(match[2])),
|
||||
'<iframe width="{}" height="{}" src="https://www.youtube.com/embed/{}" frameborder="0" allowfullscreen></iframe>'.format(match[1], match[2], match[0]))
|
||||
|
||||
# Vimeo embeds
|
||||
for match in re.findall('\[\[vimeo-(\d+)\-(\d+)x(\d+)\]\]', self.stylized):
|
||||
self.stylized = self.stylized.replace('[[vimeo-{}-{}x{}]]'.format(str(match[0]), str(match[1]), str(match[2])),
|
||||
'<iframe src="http://player.vimeo.com/video/{}" width="{}" height="{}" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'.format(match[0], match[1], match[2]))
|
||||
|
||||
else:
|
||||
self.stylized = highlight(self.code,
|
||||
get_lexer_by_name(self.lexer, encoding='UTF-8'),
|
||||
|
|
Loading…
Reference in New Issue