workaround for bug in title text regex

This commit is contained in:
Rudis Muiznieks 2014-07-04 01:18:24 -05:00
parent 673e4690dc
commit edd255f77f

View file

@ -21,6 +21,9 @@ matchAnchor = (text) ->
text: match[2]
href: match[3]
title: match[6]
if result.href.indexOf('"') == 0
result.title = result.href.substring 1, result.href.length - 1
result.href = ''
return result
return match
@ -28,11 +31,15 @@ matchAnchors = (text) ->
re = new RegExp regexLib.anchors
anchors = []
while match = re.exec text
anchors.push
anchor =
anchor: match[1]
text: match[2]
href: match[3]
title: match[6]
if anchor.href.indexOf('"') == 0
anchor.title = anchor.href.substring 1, anchor.href.length - 1
anchor.href = ''
anchors.push anchor
return anchors
trimText = (text) ->