mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-28 08:50:07 +00:00
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:
parent
53ae5aac06
commit
d8f4a31efe
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue