mirror of
https://github.com/chatmail/core.git
synced 2026-05-16 21:36:30 +03:00
fix: use correct dir converting plaintext to HTML (#8248)
It turned out for desktop the style unicode-bidi: plaintext is needed. dir="auto" didn't work. The style only without dir attribute worked too but maybe it's better to have both. With this change https://github.com/deltachat/deltachat-desktop/issues/6345 is also solved for long messages that have a "Show full message" dialog
This commit is contained in:
@@ -304,7 +304,7 @@ mod tests {
|
|||||||
<html><head>
|
<html><head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
</head><body>
|
</head><body dir="auto" style="unicode-bidi: plaintext">
|
||||||
This message does not have Content-Type nor Subject.<br/>
|
This message does not have Content-Type nor Subject.<br/>
|
||||||
</body></html>
|
</body></html>
|
||||||
"#
|
"#
|
||||||
@@ -322,7 +322,7 @@ This message does not have Content-Type nor Subject.<br/>
|
|||||||
<html><head>
|
<html><head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
</head><body>
|
</head><body dir="auto" style="unicode-bidi: plaintext">
|
||||||
message with a non-UTF-8 encoding: äöüßÄÖÜ<br/>
|
message with a non-UTF-8 encoding: äöüßÄÖÜ<br/>
|
||||||
</body></html>
|
</body></html>
|
||||||
"#
|
"#
|
||||||
@@ -341,7 +341,7 @@ message with a non-UTF-8 encoding: äöüßÄÖÜ<br/>
|
|||||||
<html><head>
|
<html><head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
</head><body>
|
</head><body dir="auto" style="unicode-bidi: plaintext">
|
||||||
This line ends with a space and will be merged with the next one due to format=flowed.<br/>
|
This line ends with a space and will be merged with the next one due to format=flowed.<br/>
|
||||||
<br/>
|
<br/>
|
||||||
This line does not end with a space<br/>
|
This line does not end with a space<br/>
|
||||||
@@ -362,7 +362,7 @@ and will be wrapped as usual.<br/>
|
|||||||
<html><head>
|
<html><head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
</head><body>
|
</head><body dir="auto" style="unicode-bidi: plaintext">
|
||||||
mime-modified should not be set set as there is no html and no special stuff;<br/>
|
mime-modified should not be set set as there is no html and no special stuff;<br/>
|
||||||
although not being a delta-message.<br/>
|
although not being a delta-message.<br/>
|
||||||
test some special html-characters as < > and & but also " and ' :)<br/>
|
test some special html-characters as < > and & but also " and ' :)<br/>
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ impl PlainText {
|
|||||||
<html><head>
|
<html><head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
</head><body>
|
</head><body dir="auto" style="unicode-bidi: plaintext">
|
||||||
"#
|
"#
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ http://link-at-start-of-line.org
|
|||||||
<html><head>
|
<html><head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
</head><body>
|
</head><body dir="auto" style="unicode-bidi: plaintext">
|
||||||
line 1<br/>
|
line 1<br/>
|
||||||
line 2<br/>
|
line 2<br/>
|
||||||
line with <a href="https://link-mid-of-line.org">https://link-mid-of-line.org</a> and <a href="http://link-end-of-line.com/file?foo=bar%20">http://link-end-of-line.com/file?foo=bar%20</a><br/>
|
line with <a href="https://link-mid-of-line.org">https://link-mid-of-line.org</a> and <a href="http://link-end-of-line.com/file?foo=bar%20">http://link-end-of-line.com/file?foo=bar%20</a><br/>
|
||||||
@@ -156,7 +156,7 @@ line with <a href="https://link-mid-of-line.org">https://link-mid-of-line.org</a
|
|||||||
<html><head>
|
<html><head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
</head><body>
|
</head><body dir="auto" style="unicode-bidi: plaintext">
|
||||||
Foo<br/>
|
Foo<br/>
|
||||||
bar<br/>
|
bar<br/>
|
||||||
</body></html>
|
</body></html>
|
||||||
@@ -178,7 +178,7 @@ bar<br/>
|
|||||||
<html><head>
|
<html><head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
</head><body>
|
</head><body dir="auto" style="unicode-bidi: plaintext">
|
||||||
line with <<a href="http://encapsulated.link/?foo=_bar">http://encapsulated.link/?foo=_bar</a>> here!<br/>
|
line with <<a href="http://encapsulated.link/?foo=_bar">http://encapsulated.link/?foo=_bar</a>> here!<br/>
|
||||||
</body></html>
|
</body></html>
|
||||||
"#
|
"#
|
||||||
@@ -199,7 +199,7 @@ line with <<a href="http://encapsulated.link/?foo=_bar">http://encapsulated.l
|
|||||||
<html><head>
|
<html><head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
</head><body>
|
</head><body dir="auto" style="unicode-bidi: plaintext">
|
||||||
line with nohttp://no.link here<br/>
|
line with nohttp://no.link here<br/>
|
||||||
</body></html>
|
</body></html>
|
||||||
"#
|
"#
|
||||||
@@ -220,7 +220,7 @@ line with nohttp://no.link here<br/>
|
|||||||
<html><head>
|
<html><head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
</head><body>
|
</head><body dir="auto" style="unicode-bidi: plaintext">
|
||||||
just an address: <a href="mailto:foo@bar.org">foo@bar.org</a> <a href="mailto:another@one.de">another@one.de</a><br/>
|
just an address: <a href="mailto:foo@bar.org">foo@bar.org</a> <a href="mailto:another@one.de">another@one.de</a><br/>
|
||||||
</body></html>
|
</body></html>
|
||||||
"#
|
"#
|
||||||
@@ -241,7 +241,7 @@ just an address: <a href="mailto:foo@bar.org">foo@bar.org</a> <a href="mailto:an
|
|||||||
<html><head>
|
<html><head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
</head><body>
|
</head><body dir="auto" style="unicode-bidi: plaintext">
|
||||||
line still line<br/>
|
line still line<br/>
|
||||||
<em>>quote </em><br/>
|
<em>>quote </em><br/>
|
||||||
<em>>still quote</em><br/>
|
<em>>still quote</em><br/>
|
||||||
@@ -265,7 +265,7 @@ line still line<br/>
|
|||||||
<html><head>
|
<html><head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
</head><body>
|
</head><body dir="auto" style="unicode-bidi: plaintext">
|
||||||
linestill line<br/>
|
linestill line<br/>
|
||||||
<em>>quote </em><br/>
|
<em>>quote </em><br/>
|
||||||
<em>>still quote</em><br/>
|
<em>>still quote</em><br/>
|
||||||
@@ -289,7 +289,7 @@ linestill line<br/>
|
|||||||
<html><head>
|
<html><head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
</head><body>
|
</head><body dir="auto" style="unicode-bidi: plaintext">
|
||||||
line <br/>
|
line <br/>
|
||||||
still line<br/>
|
still line<br/>
|
||||||
<em>>quote </em><br/>
|
<em>>quote </em><br/>
|
||||||
@@ -314,7 +314,7 @@ still line<br/>
|
|||||||
<html><head>
|
<html><head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
</head><body>
|
</head><body dir="auto" style="unicode-bidi: plaintext">
|
||||||
def foo():<br/>
|
def foo():<br/>
|
||||||
pass<br/>
|
pass<br/>
|
||||||
<br/>
|
<br/>
|
||||||
|
|||||||
Reference in New Issue
Block a user