Skip to content

Commit 5155d75

Browse files
committed
fix url trim
1 parent 1f10086 commit 5155d75

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Parser.js

Lines changed: 2 additions & 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.21",
10+
"version": "2.4.22",
1111
"scripts": {
1212
"test": "mocha",
1313
"build": "cake build"

src/Parser.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,11 +992,12 @@ class Parser
992992

993993
cleanUrl: (url, parseTitle = false) ->
994994
title = null
995+
url = trim url
995996

996997
if parseTitle
997998
pos = url.indexOf ' '
998999

999-
if pos > 0
1000+
if pos >= 0
10001001
title = htmlspecialchars trim (url.substring pos + 1), ' "\''
10011002
url = url.substring 0, pos
10021003

0 commit comments

Comments
 (0)