firechat
firechat copied to clipboard
Problem with links pasted into chat
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
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.
Re: Roko's_basilisk, try replacing linkify with Autolinker.js [https://github.com/gregjacobs/Autolinker.js]
+1 on replacing linkify with autolinker
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.