mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 16:02:23 -04:00
escape image links in clayout and preview as well (#903)
This commit is contained in:
parent
c7b31d28e4
commit
51121f6e86
4 changed files with 6 additions and 6 deletions
|
@ -1044,7 +1044,7 @@ where id in %s""" % ids2str(sf))
|
|||
ti = lambda x: x
|
||||
base = getBase(self.mw.col)
|
||||
self._previewWeb.stdHtml(
|
||||
ti(mungeQA(txt)), self.mw.reviewer._styles(),
|
||||
ti(mungeQA(self.col, txt)), self.mw.reviewer._styles(),
|
||||
bodyClass="card card%d" % (c.ord+1), head=base,
|
||||
js=anki.js.browserSel)
|
||||
clearAudioQueue()
|
||||
|
|
|
@ -222,11 +222,11 @@ Please create a new card type first."""))
|
|||
ti = self.maybeTextInput
|
||||
base = getBase(self.mw.col)
|
||||
self.tab['pform'].frontWeb.stdHtml(
|
||||
ti(mungeQA(c.q(reload=True))), self.mw.reviewer._styles(),
|
||||
ti(mungeQA(self.mw.col, c.q(reload=True))), self.mw.reviewer._styles(),
|
||||
bodyClass="card card%d" % (c.ord+1), head=base,
|
||||
js=anki.js.browserSel)
|
||||
self.tab['pform'].backWeb.stdHtml(
|
||||
ti(mungeQA(c.a()), type='a'), self.mw.reviewer._styles(),
|
||||
ti(mungeQA(self.mw.col, c.a()), type='a'), self.mw.reviewer._styles(),
|
||||
bodyClass="card card%d" % (c.ord+1), head=base,
|
||||
js=anki.js.browserSel)
|
||||
clearAudioQueue()
|
||||
|
|
|
@ -181,8 +181,7 @@ function _typeAnsPress() {
|
|||
##########################################################################
|
||||
|
||||
def _mungeQA(self, buf):
|
||||
return self.mw.col.media.escapeImages(
|
||||
self.typeAnsFilter(mungeQA(buf)))
|
||||
return self.typeAnsFilter(mungeQA(self.mw.col, buf))
|
||||
|
||||
def _showQuestion(self):
|
||||
self._reps += 1
|
||||
|
|
|
@ -317,7 +317,8 @@ def restoreHeader(widget, key):
|
|||
if aqt.mw.pm.profile.get(key):
|
||||
widget.restoreState(aqt.mw.pm.profile[key])
|
||||
|
||||
def mungeQA(txt):
|
||||
def mungeQA(col, txt):
|
||||
txt = col.media.escapeImages(txt)
|
||||
txt = stripSounds(txt)
|
||||
# osx webkit doesn't understand font weight 600
|
||||
txt = re.sub("font-weight: *600", "font-weight:bold", txt)
|
||||
|
|
Loading…
Reference in a new issue