Handle <references></references> without crashing

* Fixes rt regressions on svwiki:Havre and a bunch of other titles.

Change-Id: I1d31ccf1045ba5a4fef9377101ad4e90a534c1e9
This commit is contained in:
Subramanya Sastry 2018-08-06 23:31:53 -05:00 committed by jenkins-bot
parent 53ae5aac06
commit d8f4a31efe

View file

@ -377,6 +377,7 @@ References.prototype.toDOM = function(state, content, args) {
var frag = createReferences(state.manager.env, doc.body, refsOpts, function(dp) {
dp.src = state.extToken.getAttribute('source');
dp.selfClose = state.extToken.dataAttribs.selfClose;
});
doc.body.appendChild(frag);
@ -526,10 +527,12 @@ References.prototype.insertReferencesIntoDOM = function(refsNode, refsData, nest
dataMw.autoGenerated = true;
} else if (nestedRefsHTML.length > 0) {
dataMw.body = { 'html': '\n' + nestedRefsHTML.join('') };
} else if (dataMw.body === null) {
// Is this correct?
} else if (!dp.selfClose) {
dataMw.body = { 'html': '' };
} else {
dataMw.body = undefined;
}
dp.selfClose = undefined;
}
var refGroup = refsData.getRefGroup(group);