diff --git a/lib/ext/Cite/index.js b/lib/ext/Cite/index.js index 2bb3b481a..6c6e8726b 100644 --- a/lib/ext/Cite/index.js +++ b/lib/ext/Cite/index.js @@ -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);