lmms.io icon indicating copy to clipboard operation
lmms.io copied to clipboard

Parse links in LSP comments

Open Umcaruje opened this issue 10 years ago • 1 comments

Since we already parse links in the descrpitions, it'd be really nice if links inside comments are parsed too.

Now its really hard to follow a link like this: hard to follow

The preg_replace code for links can surely be reused, but it should look like this

$message = preg_replace('#\b((https?://)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.])+)#i', '<a href="$1" target="_blank">$1</a>', $message);

rather than this

$message = preg_replace('#([^"])\b((https?://)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.])+)#i', '$1<a href="$2" target="_blank">$2</a>', $message);

Because there are no iframes in the comments so the 'don't parse if there is an " before the link' hack isn't needed.

Umcaruje avatar Dec 08 '14 18:12 Umcaruje

Yeah, we have to be careful not to parse embed links. But I still don't know if this is a good idea.... Many commenting systems don't permit links to prevent spamming. Perhaps we only permit links back to lmms.io?

-Tres

tresf avatar Dec 08 '14 19:12 tresf