|
1 | 1 | /*!
|
2 | 2 | * Autolinker.js
|
3 |
| - * 0.26.1 |
| 3 | + * 0.27.0 |
4 | 4 | *
|
5 | 5 | * Copyright(c) 2016 Gregory Jacobs <[email protected]>
|
6 | 6 | * MIT License
|
@@ -192,7 +192,7 @@ Autolinker.link = function( textOrHtml, options ) {
|
192 | 192 | *
|
193 | 193 | * Ex: 0.25.1
|
194 | 194 | */
|
195 |
| -Autolinker.version = '0.26.1'; |
| 195 | +Autolinker.version = '0.27.0'; |
196 | 196 |
|
197 | 197 |
|
198 | 198 | Autolinker.prototype = {
|
@@ -1617,7 +1617,7 @@ Autolinker.htmlParser.HtmlParser = Autolinker.Util.extend( Object, {
|
1617 | 1617 | htmlRegex : (function() {
|
1618 | 1618 | var commentTagRegex = /!--([\s\S]+?)--/,
|
1619 | 1619 | tagNameRegex = /[0-9a-zA-Z][0-9a-zA-Z:]*/,
|
1620 |
| - attrNameRegex = /[^\s\0"'>\/=\x01-\x1F\x7F]+/, // the unicode range accounts for excluding control chars, and the delete char |
| 1620 | + attrNameRegex = /[^\s"'>\/=\x00-\x1F\x7F]+/, // the unicode range accounts for excluding control chars, and the delete char |
1621 | 1621 | attrValueRegex = /(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/, // double quoted, single quoted, or unquoted attribute values
|
1622 | 1622 | nameEqualsValueRegex = attrNameRegex.source + '(?:\\s*=\\s*' + attrValueRegex.source + ')?'; // optional '=[value]'
|
1623 | 1623 |
|
@@ -1657,7 +1657,7 @@ Autolinker.htmlParser.HtmlParser = Autolinker.Util.extend( Object, {
|
1657 | 1657 |
|
1658 | 1658 | // Zero or more attributes following the tag name
|
1659 | 1659 | '(?:',
|
1660 |
| - '\\s*', // any number of whitespace chars before an attribute |
| 1660 | + '(?:\\s+|\\b)', // any number of whitespace chars before an attribute. NOTE: Using \s* here throws Chrome into an infinite loop for some reason, so using \s+|\b instead |
1661 | 1661 | nameEqualsValueRegex, // attr="value" (with optional ="value" part)
|
1662 | 1662 | ')*',
|
1663 | 1663 |
|
|
0 commit comments