File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 11autoLink = (options ... ) ->
22 pattern = ///
3- (^ | [\s\S \ n ] | <br \/ ? >) # Capture the beginning of string or line or leading whitespace
3+ (^ | [\s \n ] | <[ A-Za-z ] * \/ ? >) # 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)
Original file line number Diff line number Diff line change @@ -116,6 +116,21 @@ describe "autolink", ->
116116 " <a href='http://google.com'>http://google.com</a> " +
117117 " That is a link to Google"
118118 )
119+ it " can have a hyperlink after a tag" , ->
120+ expect (" <li>http://google.com</li>" .autoLink ()).
121+ toEqual (
122+ " <li>" +
123+ " <a href='http://google.com'>http://google.com</a>" +
124+ " </li>"
125+ )
126+
127+ it " can have a hyperlink after two tag" , ->
128+ expect (" <li><p>http://google.com</p></li>" .autoLink ()).
129+ toEqual (
130+ " <li><p>" +
131+ " <a href='http://google.com'>http://google.com</a>" +
132+ " </p></li>"
133+ )
119134
120135 describe " callback option" , ->
121136 it " can be passed to redefine how link will be rendered" , ->
You can’t perform that action at this time.
0 commit comments