mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
stripMedia->strip
This commit is contained in:
parent
15737959f5
commit
cc9f5b8d86
2 changed files with 2 additions and 2 deletions
|
@ -97,7 +97,7 @@ If the same name exists, compare checksums."""
|
|||
l.append(fname)
|
||||
return l
|
||||
|
||||
def stripMedia(self, txt):
|
||||
def strip(self, txt):
|
||||
for reg in self.regexps:
|
||||
txt = re.sub(reg, "", txt)
|
||||
return txt
|
||||
|
|
|
@ -29,7 +29,7 @@ def test_strings():
|
|||
assert mf("aoeu<img src=\"foo.jpg\"><img class=yo src=fo>ao") == [
|
||||
"foo.jpg", "fo"]
|
||||
assert mf("aou[sound:foo.mp3]aou") == ["foo.mp3"]
|
||||
sp = d.media.stripMedia
|
||||
sp = d.media.strip
|
||||
assert sp("aoeu") == "aoeu"
|
||||
assert sp("aoeu[sound:foo.mp3]aoeu") == "aoeuaoeu"
|
||||
assert sp("a<img src=yo>oeu") == "aoeu"
|
||||
|
|
Loading…
Reference in a new issue