Broken link

See also: https://github.com/instructure/canvas-lms/issues/543
Seems safe to me.  This code looks like it just tries to convert a plain text message into HTML so that it can make the links active.  It does this by htmlEscaping the whole message, but not the links.  When it turns them into HTML links it takes the plaintext link and URLencodes it.  I don't really understand all the formats that the regex understands when looking for plaintext links, but if it picks up links that do need to be URLencoded when turned into HTML links, this will break those.  If we run into that, we should add a suite of unit tests around what plain text links should be recognized and how they are converted to HTML.