From 4d2ef81ad544e8e5ae0c61bb7e7af388123c0f33 Mon Sep 17 00:00:00 2001 From: Anil Anar Date: Sat, 28 Nov 2015 21:27:51 +0100 Subject: [PATCH] prioritize attribute extraction over html content. --- lib/extract.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/extract.js b/lib/extract.js index cae964a..081f657 100644 --- a/lib/extract.js +++ b/lib/extract.js @@ -345,8 +345,8 @@ var Extractor = (function () { if (possibleAttributes.indexOf(attr) > -1) { var attrValue = extracted[attr]; - str = node.html(); // this shouldn't be necessary, but it is - self.addString(reference(n.startIndex), str || getAttr(attr) || '', attrValue.plural, attrValue.extractedComment, attrValue.context); + str = getAttr(attr); + self.addString(reference(n.startIndex), str || node.html() || '', attrValue.plural, attrValue.extractedComment, attrValue.context); } else if (matches = noDelimRegex.exec(node.attr(attr))) { str = matches[2].replace(/\\\'/g, '\''); self.addString(reference(n.startIndex), str);