From 6c61dc180b2de65aced6bfbc8a8f6559d907f7ee Mon Sep 17 00:00:00 2001 From: aakatov Date: Sat, 23 Dec 2017 12:36:26 +0300 Subject: [PATCH] fix play sound with HTML special symbols in its filename --- anki/sound.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/anki/sound.py b/anki/sound.py index dc573b9af..097b496b5 100644 --- a/anki/sound.py +++ b/anki/sound.py @@ -2,6 +2,7 @@ # Copyright: Damien Elmes # 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 random from anki.hooks import addHook @@ -14,6 +15,8 @@ _soundReg = "\[sound:(.*?)\]" def playFromText(text): for match in allSounds(text): + # filename is html encoded + match = html.unescape(match) play(match) def allSounds(text):