From 3b44e7e544a830fff4abc17bb35e7c88d6b7fed0 Mon Sep 17 00:00:00 2001 From: Arlo Breault Date: Fri, 5 Feb 2016 10:54:28 -0800 Subject: [PATCH] Remove extsrc bloat from references data-mw * This hasn't been used since 2013! See 46ddbf3f Change-Id: Iea382829f38788541b3bc4f8595a0d6bf600c167 --- lib/ext/Cite.js | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/lib/ext/Cite.js b/lib/ext/Cite.js index b28f0494b..7b77735ce 100644 --- a/lib/ext/Cite.js +++ b/lib/ext/Cite.js @@ -484,32 +484,24 @@ References.prototype.extractRefFromNode = function(node, refsData, References.prototype.insertReferencesIntoDOM = function(refsNode, refsData, refsInReferencesHTML) { var dp = DU.getDataParsoid(refsNode); var group = dp.group || ''; - var src = dp.src || ''; // fall back so we don't crash - // Extract ext-source for .. usage - var body = Util.extractExtBody("references", src).trim(); - var refGroup = refsData.getRefGroup(group); var dataMw = DU.getDataMw(refsNode); if (!Object.keys(dataMw).length) { - var datamwBody; - // We'll have to output data-mw.body.extsrc in - // scenarios where original wikitext was of the form: - // " lot of refs here " - // Ex: See [[en:Barack Obama]] - if (body.length > 0) { - datamwBody = { - 'extsrc': body, - 'html': refsInReferencesHTML.join(''), - }; - } dataMw = { 'name': 'references', - 'body': datamwBody, 'attrs': { // Dont emit empty keys 'group': group || undefined, }, }; + + var src = dp.src || ''; // fall back so we don't crash + // Extract ext-source for .. usage + var body = Util.extractExtBody('references', src).trim(); + if (body.length > 0) { + dataMw.body = { 'html': refsInReferencesHTML.join('') }; + } + DU.setDataMw(refsNode, dataMw); } @@ -522,6 +514,7 @@ References.prototype.insertReferencesIntoDOM = function(refsNode, refsData, refs refsNode.removeChild(refsNode.firstChild); } + var refGroup = refsData.getRefGroup(group); if (refGroup) { refGroup.refs.forEach(refGroup.renderLine.bind(refGroup, refsNode)); }