core icon indicating copy to clipboard operation
core copied to clipboard

truncate long URLs and long texts

Open condr-at opened this issue 3 years ago • 4 comments

URLs in default emails often very long because they has a lot of parameters, so message bubble grows to multiple screens even if original message is short.

condr-at avatar Jun 17 '22 15:06 condr-at

yip, this is an issue. the long urls mainly comes from html-mails converted to plain text. same for other stuff that is not really content.

the idea is to truncate these html-mails massively to at most 20 lines or so - or just before the first long url. then., the "show full message" button will be more visilbe - and the full message view usually shows these urls without issues.

however, all that cannot be done in ios but needs to be done in core; we should file an issue for that at some point.

r10s avatar Jun 17 '22 20:06 r10s

Desktop and the https://github.com/deltachat/message-parser both support labeled links: [label](link), that could be an alternative solution to just cutting them short and displaying "read full message" button.

the idea is to truncate these html-mails massively to at most 20 lines or so

I have a branch that implements cutting by lines, I will make an pr soon.

Edit: the pr is ready https://github.com/deltachat/deltachat-core-rust/pull/3480

Simon-Laux avatar Jul 05 '22 09:07 Simon-Laux

i think, we should just stop trying to convert complex html code to plain text, labeled links can maybe mitigate stuff, but not really fix the issue when some bleiwüste comes in.

r10s avatar Jul 05 '22 11:07 r10s

probably will be already an improvement to change DC_DESIRED_TEXT_LEN to something like 2000 in src/constants.rs

adbenitez avatar Jul 11 '22 09:07 adbenitez

With #3480 merged we can consider the issue to be fixed. Parsing the message and finding URLs to truncate is a task for the UI and message parser.

link2xt avatar Oct 10 '23 01:10 link2xt