diff --git a/ankiqt/ui/facteditor.py b/ankiqt/ui/facteditor.py index 12e8aa4fc..e02ad3c59 100644 --- a/ankiqt/ui/facteditor.py +++ b/ankiqt/ui/facteditor.py @@ -13,7 +13,7 @@ import anki.sound from ankiqt import ui import ankiqt from ankiqt.ui.utils import mungeQA, saveGeom, restoreGeom, getBase -from anki.hooks import addHook, removeHook, runHook +from anki.hooks import addHook, removeHook, runHook, runFilter from sqlalchemy.exceptions import InvalidRequestError from PyQt4 import pyqtconfig QtConfig = pyqtconfig.Configuration() @@ -1048,14 +1048,17 @@ class PreviewDialog(QDialog): def updateCard(self): c = self.cards[self.currentCard] + styles = (self.deck.css + + ("\nhtml { background: %s }" % c.cardModel.lastFontColour) + + "\ndiv { white-space: pre-wrap; }") + styles = runFilter("addStyles", styles) self.dialog.webView.setHtml( ('
%s' % getBase(self.deck)) + - "" + - mungeQA(self.deck, c.htmlQuestion()) + + "" + + runFilter("drawQuestion", mungeQA(self.deck, c.htmlQuestion())) + "