10000 fix parseLink · segmentfault/HyperDown.js@1f10086 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1f10086

Browse files
committed
fix parseLink
1 parent 8e768bd commit 1f10086

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Parser.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"license": "BSD-4-Clause",
99
"author": "SegmentFault",
10-
"version": "2.4.20",
10+
"version": "2.4.21",
1111
"scripts": {
1212
"test": "mocha",
1313
"build": "cake build"

src/Parser.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ class Parser
338338
text = text.replace /(^|[^\"])(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)|(?:mailto:)?[_a-z0-9-\.\+]+@[_\w-]+\.[a-z]{2,})($|[^\"])/g, (matches...) =>
339339
url = @cleanUrl matches[2]
340340
link = @call 'parseLink', url
341-
"#{matches[1]}<a href=\"#{link}\">#{matches[2]}</a>#{matches[5]}"
341+
"#{matches[1]}<a href=\"#{url}\">#{link}</a>#{matches[5]}"
342342

343343
text = @call 'afterParseInlineBeforeRelease', text
344344
text = @releaseHolder text, clearHolders

0 commit comments

Comments
 (0)
0