Fix image position and filter() return

This commit is contained in:
miruka 2019-04-17 14:27:22 -04:00
parent c4f46f42b6
commit 7e62da8733
3 changed files with 6 additions and 1 deletions

View File

@ -30,3 +30,5 @@
- Make links in room subtitle clickable, formatting?
- Push instead of replacing in stack view
- QQuickImageProvider, matrix preview API

View File

@ -52,7 +52,7 @@ class HtmlFilter(QObject):
for el in tree.iter("a"):
el = self._append_img_to_a(el)
return str(etree.tostring(tree[0][0], encoding="utf-8"), "utf-8")
return str(etree.tostring(tree, encoding="utf-8"), "utf-8")
@pyqtProperty("QVariant")
@ -140,6 +140,7 @@ class HtmlFilter(QObject):
for _ in el.iter("img"): # if the <a> already has an <img> child
return el
el.append(etree.Element("br"))
el.append(etree.Element("img", src=link, width="256", height="256"))
return el

View File

@ -24,5 +24,7 @@ Rectangle {
// Keep x scroll pages cached, to limit images having to be
// reloaded from network.
cacheBuffer: height * 6
//Component.onCompleted: positionViewAtEnd()
}
}