Modify regex to only grab 32 char keys

master
Nick Sergeant 2012-06-04 18:28:42 -04:00
parent 3da5aa017a
commit bcdfee8232
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ class Snipt(models.Model):
if self.lexer == 'markdown':
self.stylized = markdown(self.code, 'default')
for match in re.findall('\[\[(.*)\]\]', self.stylized):
for match in re.findall('\[\[(\w{32})\]\]', self.stylized):
self.stylized = self.stylized.replace('[[' + str(match) + ']]',
'<script type="text/javascript" src="https://snipt.net/embed/{}/?snipt"></script><div id="snipt-embed-{}"></div>'.format(match, match))
else: