From f636b71b8c4b67da9839be11e89e95aa8b49c1e9 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 17 Jan 2009 17:37:07 +0900 Subject: [PATCH] strip field model html on text card export --- anki/exporting.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/anki/exporting.py b/anki/exporting.py index ee484d601..6f4fa9df2 100644 --- a/anki/exporting.py +++ b/anki/exporting.py @@ -8,7 +8,7 @@ Exporting support """ __docformat__ = 'restructuredtext' -import itertools, time +import itertools, time, re from operator import itemgetter from anki import DeckStorage from anki.cards import Card @@ -28,9 +28,10 @@ class Exporter(object): file.close() def escapeText(self, text): - "Escape newlines and tabs." + "Escape newlines and tabs, and strip Anki HTML." text = text.replace("\n", "
") text = text.replace("\t", " " * 8) + text = re.sub('(.*?)', '\\1', text) return text def cardIds(self):