Skip to content

Commit a21e996

Browse files
improve matching
to make it work for the following examples: <p>http://google.com</p> <li>http://google.com</li>
1 parent fd46223 commit a21e996

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autolink.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
autoLink = (options...) ->
22
pattern = ///
3-
(^|[\s\n]|<br\/?>) # Capture the beginning of string or line or leading whitespace
3+
(^|[\s\S\n]|<br\/?>) # Capture the beginning of string or line or leading whitespace
44
(
55
(?:https?|ftp):// # Look for a valid URL protocol (non-captured)
66
[\-A-Z0-9+\u0026\u2019@#/%?=()~_|!:,.;]* # Valid URL characters (any number of times)

0 commit comments

Comments
 (0)