gregjacobs/Autolinker.js — pull request #29 by aziraphale (2014-05-07 11:12:38+00:00)
Title: Improve `htmlRegex` to allow hyphens (etc.) in attribute names

Updated the `htmlRegex` so that its allowed ranges of characters for HTML tag
names and attribute names more closely reflect those specified by the W3C HTML
Syntax document (http://www.w3.org/TR/html-markup/syntax.html).

Specifically, this allows attribute names containing hyphens (such as
`data-blah="foo"` attributes, as made popular by jQuery) and should also permit
tags with XML namespaces. Previously if tags containing "invalid" attribute
names were passed into the `link()` function, the HTML string would be
completely bastardised, entirely stripping out most tag values (I ended up with
a sizeable document containing lots of markup but no actual content!).