firechat icon indicating copy to clipboard operation
firechat copied to clipboard

Problem with links pasted into chat

Open davidhq opened this issue 10 years ago • 4 comments

This link broke in chat because of apostophe: http://rationalwiki.org/wiki/Roko's_basilisk

!! these didn't work at all (it was blank): http://www.oeticket.com/de/tickets/scott-bradlee-postmodern-jukebox-wien-porgy-bess-378619/event.html http://www.independent.co.uk/life-style/gadgets-and-tech/news/microsoft-to-replace-internet-explorer-with-new-streamlined-browser-9949448.html

davidhq avatar Dec 31 '14 21:12 davidhq

This is not a bug. If you look inside your firebase, the message will have been trimmed with an ellipsis because the maxLengthMessage has been set to 120 characters in the example. If you remove or lift the constraint firebase will store your message as originally intended, and the message should appear with the link.

gmonaie avatar Mar 22 '15 22:03 gmonaie

Re: Roko's_basilisk, try replacing linkify with Autolinker.js [https://github.com/gregjacobs/Autolinker.js]

gmonaie avatar Mar 22 '15 22:03 gmonaie

+1 on replacing linkify with autolinker

nightpool avatar Sep 23 '15 12:09 nightpool

looks like linking is done with regexes:

this.urlPattern = \
  /\b(?:https?|ftp):\/\/[a-z0-9-+&@#\/%?=~_|!:,.;]*[a-z0-9-+&@#\/%=~_|]/gim;
this.pseudoUrlPattern = /(^|[^\/])(www\.[\S]+(\b|$))/gim;

https://github.com/firebase/firechat/blob/master/src/js/firechat-ui.js#L46-L47 rather then a library.

nightpool avatar Sep 23 '15 12:09 nightpool