mirror of
https://github.com/russross/blackfriday.git
synced 2024-03-22 13:40:34 +08:00
make autolink peforms like GFM
This commit is contained in:
parent
8751c35d1a
commit
16c09b01bd
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user