Skip to content

Commit e2a1ef6

Browse files
authored
Merge pull request #13 from SegmentFault/fix-url
fix url 中有感叹号的情况
2 parents ed95914 + 5c26d7c commit e2a1ef6

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ node_modules
22
npm-debug.log
33
.vscode
44
typings
5+
.idea

Parser.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Parser.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ class Parser
245245

246246
# autolink url
247247
if enableAutoLink
248-
text = text.replace /(^|[^"])((https?):[x80-xff_a-z0-9-\.\/%#@\?\+=~\|\,&\(\)]+)($|[^"])/ig, (matches...) =>
248+
text = text.replace /(^|[^"])((https?):[x80-xff_a-z0-9-\.\/%#!@\?\+=~\|\,&\(\)]+)($|[^"])/ig, (matches...) =>
249249
link = @call 'parseLink', matches[2]
250250
"#{matches[1]}<a href=\"#{matches[2]}\">#{link}</a>#{matches[4]}"
251251

0 commit comments

Comments
 (0)