Hyperkitty shows "<" as <
Hi fellow Hyperkitties,
I migrated from Mailman 2 to 3 and imported my 1st list via manage.py hyperkitty_import
to Hyperkitty 1.3.4 (the Debian package), but that
might not even be relevant to my problem:
All "<" and ">" in old and new messages are shown as "<" and ">" in message views _however_ they are shown correctly in overview abstracts e.g. at //server/mm3/hyperkitty/list/testlist@server/latest
Is this a bug in Hyperkitty? Or is our server doing something funky?
-- -- Andreas
:-)
On 4/4/23 09:53, Andreas Schamanek wrote:
Hi fellow Hyperkitties,
I migrated from Mailman 2 to 3 and imported my 1st list via
manage.py hyperkitty_import
to Hyperkitty 1.3.4 (the Debian package), but that might not even be relevant to my problem:All "<" and ">" in old and new messages are shown as "<" and ">" in message views _however_ they are shown correctly in overview abstracts e.g. at //server/mm3/hyperkitty/list/testlist@server/latest
I don't think I've ever seen this. Certainly it is not the case on this list with either current messages such as those in this thread <https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/4LC4VT4EYMHHKU6IWGHHJ2OA4G32LZE7/> or in old threads on the mailman-users@python.org list imported with hyperkitty_import such as https://mail.python.org/archives/list/mailman-users@python.org/thread/A2DCHV...
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Thanks Mark, Your support is unparalleled.
On Tue, 4 Apr 2023, at 10:44, Mark Sapiro wrote:
On 4/4/23 09:53, Andreas Schamanek wrote:
All "<" and ">" in old and new messages are shown as "<" and ">" in message views _however_ they are shown correctly in overview abstracts e.g. at //server/mm3/hyperkitty/list/testlist@server/latest
I don't think I've ever seen this. Certainly it is not the case on this list with either current messages such as those in this thread <https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/4LC4VT4EYMHHKU6IWGHHJ2OA4G32LZE7/>
I tried to dig deeper and realized that on my test list "<" and ">" are only mangled when they surround email addresses as e.g. in
<user@example.net> (ie. < user @ example . net >)
I see that lists.mailman3.org renders such addresses as e.g.
<a target="_blank" href="mailto:user@example.net">user@example.net</a>
whereas my Hyperkitty shows them as
<user(a)example.nett>
But I have not yet found the responsible code or setting since it seems this is related to the option to obscure addresses.
Or is my Hyperkitty 1.3.4 simply too old?
-- -- Andreas
:-)
It seems I found an easy enough hack.
On Wed, 5 Apr 2023, at 01:34, Andreas Schamanek wrote:
I tried to dig deeper and realized that on my test list "<" and ">" are only mangled when they surround email addresses as e.g. in
<user@example.net> (ie. < user @ example . net >) (...) whereas my Hyperkitty [1.3.4] shows them as
<user(a)example.net>
This is related to the flag "escapeemaillinks" in templates/hyperkitty/messages/message.html
The function that handles it is escapeemaillinks() in templatetags/hk_generic.py (at line 111 in my version).
Adding .replace("&","&")
to the return value fixes the rendering
of email addresses (at least for me).
-- -- Andreas
:-)
On 4/5/23 07:39, Andreas Schamanek wrote:
The function that handles it is escapeemaillinks() in templatetags/hk_generic.py (at line 111 in my version).
Adding
.replace("&","&")
to the return value fixes the rendering of email addresses (at least for me).
escapeemaillinks(text) searches text for strings like
<a href="mailto:user@example.com>xxx</a>
and replaces them with
user(a)example.com
thus replacing everything from <a href=
through </a>
with just the
email address with @
replaced by (a)
However, text is the whole message body, so what you are doing is just
replacing &
with &
in the message body, but only when
escapeemaillinks(text) is invoked.
Also, this is all changed in HyperKitty 1.3.5 with the addition of optional markdown rendering.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Andreas Schamanek
-
Mark Sapiro