mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 00:12:25 -04:00
don't include audio in {{FrontSide}}
This commit is contained in:
parent
05538f9ef2
commit
d47dfc1780
2 changed files with 4 additions and 1 deletions
|
@ -492,7 +492,7 @@ where c.nid = n.id and c.id in %s group by nid""" % ids2str(cids)):
|
||||||
else:
|
else:
|
||||||
format = format.replace("{{cloze:", "{{ca:%d:" % (
|
format = format.replace("{{cloze:", "{{ca:%d:" % (
|
||||||
data[4]+1))
|
data[4]+1))
|
||||||
fields['FrontSide'] = d['q']
|
fields['FrontSide'] = self.media.stripAudio(d['q'])
|
||||||
fields = runFilter("mungeFields", fields, model, data, self)
|
fields = runFilter("mungeFields", fields, model, data, self)
|
||||||
html = anki.template.render(format, fields)
|
html = anki.template.render(format, fields)
|
||||||
d[type] = runFilter(
|
d[type] = runFilter(
|
||||||
|
|
|
@ -121,6 +121,9 @@ If the same name exists, compare checksums."""
|
||||||
txt = re.sub(reg, "", txt)
|
txt = re.sub(reg, "", txt)
|
||||||
return txt
|
return txt
|
||||||
|
|
||||||
|
def stripAudio(self, txt):
|
||||||
|
return re.sub(self.regexps[0], "", txt)
|
||||||
|
|
||||||
def escapeImages(self, string):
|
def escapeImages(self, string):
|
||||||
# Feeding webkit unicode can result in it not finding images, so on
|
# 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
|
# linux/osx we percent escape the image paths as utf8. On Windows the
|
||||||
|
|
Loading…
Reference in a new issue