apparently discourse allows single-quoted attribute values in HTML; fix the lookahead in the PageDown auto-linker to account for that

This commit is contained in:
balpha 2013-02-24 14:13:00 +01:00
parent 1640616c06
commit 378b594b2d
1 changed files with 1 additions and 1 deletions

View File

@ -1270,7 +1270,7 @@ else
// must be preceded by a non-word character (and not by =" or <) and followed by non-word/EOF character
// simulating the lookbehind in a consuming way is okay here, since a URL can neither and with a " nor
// with a <, so there is no risk of overlapping matches.
text = text.replace(/(="|<)?\b(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;]*[-A-Z0-9+&@#\/%=~_|\[\])])(?=$|\W)/gi, handleTrailingParens);
text = text.replace(/(="|='|<)?\b(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;]*[-A-Z0-9+&@#\/%=~_|\[\])])(?=$|\W)/gi, handleTrailingParens);
// autolink anything like <http://example.com>