mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 08:22:24 -04:00
pre-wrap spaces, support indentation by user / programming etc
This commit is contained in:
parent
d9b9840cce
commit
e63b7ef06d
2 changed files with 4 additions and 3 deletions
|
@ -281,7 +281,7 @@ class FactEditor(object):
|
|||
old = tidyHTML(unicode(w.toHtml()))
|
||||
# only update if something has changed, to preserve the cursor
|
||||
if new != old:
|
||||
w.setHtml(new)
|
||||
w.setHtml('<meta name="qrichtext" content="1"/>' + new)
|
||||
if font:
|
||||
# apply fonts
|
||||
font = QFont()
|
||||
|
@ -594,7 +594,7 @@ class FactEdit(QTextEdit):
|
|||
html = re.sub('<style type="text/css">.*?</style>', "", html)
|
||||
html = stripHTML(html)
|
||||
html = html.replace("\n", "<br>")
|
||||
html = re.sub("\s\s+", " ", html).strip()
|
||||
html = html.strip()
|
||||
return html
|
||||
|
||||
def focusOutEvent(self, evt):
|
||||
|
|
|
@ -87,7 +87,8 @@ class View(object):
|
|||
(base, family, size, color))
|
||||
s += ("body { background-color: " +
|
||||
self.main.config["backgroundColour"] +
|
||||
"; }")
|
||||
";}\n")
|
||||
s += "div { white-space: pre-wrap; }"
|
||||
s += "</style>"
|
||||
return s
|
||||
|
||||
|
|
Loading…
Reference in a new issue