Skip to content

Commit 387134a

Browse files
author
Ren Yubin
committed
fix: 解决链接无法识别端口号的问题
1 parent 82c7b08 commit 387134a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Parser.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Parser.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ class Parser
335335

336336
# autolink url
337337
if enableAutoLink
338-
regex = new RegExp "(^|[^\"])((https?):[#{pL}_0-9-\\./%#!@\\?\\[\\]\\+=~\\|\\,&\\(\\)]+)($|[^\"])", 'ig'
338+
regex = new RegExp "(^|[^\"])((https?):[#{pL}_0-9-\\./%#!:@\\?\\[\\]\\+=~\\|\\,&\\(\\)]+)($|[^\"])", 'ig'
339339
text = text.replace regex, (matches...) =>
340340
link = @call 'parseLink', matches[2]
341341
"#{matches[1]}<a href=\"#{matches[2]}\">#{link}</a>#{matches[4]}"
@@ -1013,7 +1013,7 @@ class Parser
10131013

10141014

10151015
cleanUrl: (url) ->
1016-
regexUrl = new RegExp "^\\s*((http|https|ftp|mailto):[#{pL}_a-z0-9-:\\.\\*/%#;!@\\?\\[\\]\\+=~\\|\\,&\\(\\)]+)", 'i'
1016+
regexUrl = new RegExp "^\\s*((http|https|ftp|mailto):[#{pL}_a-z0-9-:\\.\\*/%#;:!@\\?\\[\\]\\+=~\\|\\,&\\(\\)]+)", 'i'
10171017
regexWord = new RegExp "^\\s*([#{pL}_a-z0-9-:\\.\\*/%#!@\\?\\+=~\\|\\,&]+)", 'i'
10181018

10191019
if !!(matches = url.match regexUrl)

0 commit comments

Comments
 (0)