mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 14:17:13 -05:00
Merge pull request #80 from rubyu/fix-text-exporter
Fixes an issue fields are not being escaped in doExport().
This commit is contained in:
commit
d25052a56f
1 changed files with 3 additions and 1 deletions
|
|
@ -20,10 +20,12 @@ class Exporter(object):
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
def escapeText(self, text):
|
def escapeText(self, text):
|
||||||
"Escape newlines, tabs and CSS."
|
"Escape newlines, tabs, CSS and quotechar."
|
||||||
text = text.replace("\n", "<br>")
|
text = text.replace("\n", "<br>")
|
||||||
text = text.replace("\t", " " * 8)
|
text = text.replace("\t", " " * 8)
|
||||||
text = re.sub("(?i)<style>.*?</style>", "", text)
|
text = re.sub("(?i)<style>.*?</style>", "", text)
|
||||||
|
if "\"" in text:
|
||||||
|
text = "\"" + text.replace("\"", "\"\"") + "\""
|
||||||
return text
|
return text
|
||||||
|
|
||||||
def cardIds(self):
|
def cardIds(self):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue