From edd255f77fa5e6ddd804e8e237f1859a4421bb7d Mon Sep 17 00:00:00 2001 From: Rudis Muiznieks Date: Fri, 4 Jul 2014 01:18:24 -0500 Subject: [PATCH] workaround for bug in title text regex --- src/util.coffee | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/util.coffee b/src/util.coffee index 98049df..7529c3d 100644 --- a/src/util.coffee +++ b/src/util.coffee @@ -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) ->