diff --git a/anki/collection.py b/anki/collection.py index 57e82a60c..c890f3e16 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -14,6 +14,7 @@ from anki.decks import DeckManager from anki.tags import TagManager from anki.consts import * from anki.errors import AnkiError +from anki.sound import stripSounds import anki.latex # sets up hook import anki.cards, anki.notes, anki.template, anki.find @@ -491,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'] = self.media.stripAudio(d['q']) + fields['FrontSide'] = stripSounds(d['q']) fields = runFilter("mungeFields", fields, model, data, self) html = anki.template.render(format, fields) d[type] = runFilter( diff --git a/anki/media.py b/anki/media.py index 55e0d9261..4edf9bcdd 100644 --- a/anki/media.py +++ b/anki/media.py @@ -121,9 +121,6 @@ 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