lmms.io
lmms.io copied to clipboard
Parse links in LSP 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:
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.
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