element-hq / element-meta

Shared/meta documentation and project artefacts for Element clients
72 stars 12 forks source link

Linkify URLs before sending #1272

Open KitsuneRal opened 6 years ago

KitsuneRal commented 6 years ago

Description

Right now Riot linkifies even those URLs that arrive in formatted_body; conversely, Riot doesn't do anything with URLs in the original text before sending (unless, of course, I explicitly adorn it with Markdown). Messing with HTML is fun :) - and I have no inclination to do that in Quaternion. I suppose that it would be more consistent and friendly to other clients if Riot linkified URLs before sending, so that others don't have to go extra mile in linkifying URLs.

Steps to reproduce

Here's how formatted_body of $1510245375868140FtDwy:matrix.org looks like:

<a href=\"https://matrix.to/#/@stonehead:matrix.cni-coop.net\">Stonehead</a>: https://github.com/vector-im/riot-web/issues/2286
t3chguy commented 6 years ago

That wouldn't be all that consistent, riot linkifies plain text too (e.g body) like in the topic of rooms which can't be linkified on send as it doesn't support formatting

KitsuneRal commented 6 years ago

My point is, since Riot converts Markdown to HTML anyway, wouldn't it be so kind to convert URLs along the way. Plain text is plain text, there's no expectation to it having any kind of formatting. Otherwise each of Quaternion, Tensor, uMatriks, as well as others, has to do non-trivial diving into HTML in formatted_body instead of simply passing it to whatever HTML renderer they have at hand.