From 0534ce5d40dcd7790a8f49978e7f9b83d0c0e61a Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 25 Apr 2009 01:16:06 +0900 Subject: [PATCH] don't convert \n to
and vice versa in card templates --- ankiqt/ui/modelproperties.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ankiqt/ui/modelproperties.py b/ankiqt/ui/modelproperties.py index 4f37353a2..b1043bb10 100644 --- a/ankiqt/ui/modelproperties.py +++ b/ankiqt/ui/modelproperties.py @@ -289,8 +289,8 @@ class ModelProperties(QDialog): self.currentCard = self.m.cardModels[self.dialog.cardList.currentRow()] card = self.currentCard self.dialog.cardName.setText(card.name) - self.dialog.cardQuestion.setPlainText(card.qformat.replace("
", "\n")) - self.dialog.cardAnswer.setPlainText(card.aformat.replace("
", "\n")) + self.dialog.cardQuestion.setPlainText(card.qformat.replace("
", "
\n")) + self.dialog.cardAnswer.setPlainText(card.aformat.replace("
", "
\n")) self.dialog.questionInAnswer.setChecked(card.questionInAnswer) self.dialog.allowEmptyAnswer.setChecked(card.allowEmptyAnswer) self.dialog.typeAnswer.clear() @@ -335,10 +335,10 @@ order by n""", id=card.id) newname = _("Card %d") % (self.m.cardModels.index(card) + 1) self.updateField(card, 'name', newname) s = unicode(self.dialog.cardQuestion.toPlainText()) - s = s.replace("\n", "
") + s = s.replace("
\n", "
") changed = self.updateField(card, 'qformat', s) s = unicode(self.dialog.cardAnswer.toPlainText()) - s = s.replace("\n", "
") + s = s.replace("
\n", "
") changed2 = self.updateField(card, 'aformat', s) changed = changed or changed2 self.updateField(card, 'questionInAnswer', self.dialog.questionInAnswer.isChecked())