linkified URLs in plain text messages include tailing linebreaks

Bug #691020 reported by Bernd Prünster
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Postler
Fix Released
Medium
Cris Dywan

Bug Description

am am quite sure this has nothing (not much) to do with encoding, since the behavior is reproducable:
when a plain text messages is linkified, the hyperlinks tend to look like this: http://www.example.com/<br><br>You
if The message is somethign like
"Welcome to www.example.com
You have received this email..."

second issue related to this:
www.example.com is fine,
www.example.com/about/team/Johnny_Walker becomes <a href="www.example.com/about/team/Johnny">www.example.com/about/team/Johnny</a>[whitespace]Walker

i would suggest linkifying everything after http://, www., ftp:// until we encounter a whitespace, if this is done already we seriously need to fix encoding ;-)

Revision history for this message
Cris Dywan (kalikiana) wrote :

We use regular expressions for this, namely:

    const string[] link_formats = {
        "(https?:\\/\\/\\S+)",
        "([a-zA-Z0-9.\\-]+@[a-zA-Z0-9.\\-]+[a-zA-Z0-9.]+)"

Revision history for this message
Cris Dywan (kalikiana) wrote :

The solution is to exclude < from parsing. The line breaks turned into <br> are the issue here.

Changed in postler:
assignee: nobody → Christian Dywan (kalikiana)
importance: Undecided → Medium
milestone: none → 0.1
status: New → Fix Committed
Cris Dywan (kalikiana)
Changed in postler:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.