mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 14:17:13 -05:00
fix play sound with HTML special symbols in its filename
This commit is contained in:
parent
ef323e2d35
commit
6c61dc180b
1 changed files with 3 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
|
import html
|
||||||
import re, sys, threading, time, subprocess, os, atexit
|
import re, sys, threading, time, subprocess, os, atexit
|
||||||
import random
|
import random
|
||||||
from anki.hooks import addHook
|
from anki.hooks import addHook
|
||||||
|
|
@ -14,6 +15,8 @@ _soundReg = "\[sound:(.*?)\]"
|
||||||
|
|
||||||
def playFromText(text):
|
def playFromText(text):
|
||||||
for match in allSounds(text):
|
for match in allSounds(text):
|
||||||
|
# filename is html encoded
|
||||||
|
match = html.unescape(match)
|
||||||
play(match)
|
play(match)
|
||||||
|
|
||||||
def allSounds(text):
|
def allSounds(text):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue