GjjvdBurg/signal2html

Links in messages are not clickable

Closed this issue · 3 comments

sbaum commented

Hi, is it intentional that hyperlinks in the messages are not clickable? If not, that could be implemented like this:

Insert these lines into html.py:

import re
...
def format_message(body, mentions={}):
    ...
    for u in re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', new_body):
        new_body = new_body.replace(u, '<a href="%s" target="_blank">%s</a>' % (u, u), 1)
    return new_body

And make the links yellow for improved readability, by inserting into thread.html:

      .msg pre a {
        color: yellow;
      }

Thanks for suggesting this @sbaum! I've added your suggested fix in #38. I've kept the links white to match how they appear in Signal.

sbaum commented

@GjjvdBurg Thank you for adding this feature! I've checked #38 and it's working as expected.

Thanks for confirming that it works @sbaum!