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) ->