don't include audio in {{FrontSide}}

This commit is contained in:
Damien Elmes 2012-07-04 18:17:08 +09:00
parent 05538f9ef2
commit d47dfc1780
2 changed files with 4 additions and 1 deletions

View file

@ -492,7 +492,7 @@ where c.nid = n.id and c.id in %s group by nid""" % ids2str(cids)):
else:
format = format.replace("{{cloze:", "{{ca:%d:" % (
data[4]+1))
fields['FrontSide'] = d['q']
fields['FrontSide'] = self.media.stripAudio(d['q'])
fields = runFilter("mungeFields", fields, model, data, self)
html = anki.template.render(format, fields)
d[type] = runFilter(

View file

@ -121,6 +121,9 @@ If the same name exists, compare checksums."""
txt = re.sub(reg, "", txt)
return txt
def stripAudio(self, txt):
return re.sub(self.regexps[0], "", txt)
def escapeImages(self, string):
# Feeding webkit unicode can result in it not finding images, so on
# linux/osx we percent escape the image paths as utf8. On Windows the