Break http images and implement barebones spoiler support when not in mobile mode

see #1042
see #483
This commit is contained in:
Nicolas Werner 2022-08-17 01:06:28 +02:00
parent 0e4932d973
commit 08b304eccf
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
2 changed files with 124 additions and 33 deletions

View file

@ -34,7 +34,11 @@ MatrixText {
border: 1px solid " + Nheko.colors.text + ";
}
blockquote { margin-left: 1em; }
</style>
" + (enabled ? "span[data-mx-spoiler] {
color: transparent;
background-color: " + Nheko.colors.text + ";
}" : "") + // TODO(Nico): Figure out how to support mobile
"</style>
" + formatted.replace(/<pre>/g, "<pre style='white-space: pre-wrap; background-color: " + Nheko.colors.alternateBase + "'>").replace(/<del>/g, "<s>").replace(/<\/del>/g, "</s>").replace(/<strike>/g, "<s>").replace(/<\/strike>/g, "</s>")
width: parent.width
height: !keepFullText ? Math.round(Math.min(timelineView.height / 8, implicitHeight)) : implicitHeight