From 16c09b01bd4fba32c47d078a1fce3096c2e4b59c Mon Sep 17 00:00:00 2001 From: athom Date: Fri, 9 Aug 2013 16:28:35 +0800 Subject: [PATCH] make autolink peforms like GFM --- inline.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inline.go b/inline.go index ab58685..1070762 100644 --- a/inline.go +++ b/inline.go @@ -620,7 +620,7 @@ func autoLink(p *parser, out *bytes.Buffer, data []byte, offset int) int { // scan backward for a word boundary rewind := 0 - for offset-rewind > 0 && rewind <= 7 && !isspace(data[offset-rewind-1]) && !isspace(data[offset-rewind-1]) { + for offset-rewind > 0 && rewind <= 7 && isalnum(data[offset-rewind-1]) { rewind++ } if rewind > 6 { // longest supported protocol is "mailto" which has 6 letters