diff --git a/lib/ext/Cite/index.js b/lib/ext/Cite/index.js index 6c6e8726b..9fbedfe0a 100644 --- a/lib/ext/Cite/index.js +++ b/lib/ext/Cite/index.js @@ -41,7 +41,9 @@ function hasRef(node) { Ref.prototype.toDOM = function(state, content, args) { // Drop nested refs entirely, unless we've explicitly allowed them - if (state.parseContext.extTag === 'ref' && !state.parseContext.allowNestedRef) { + if (state.parseContext.extTag === 'ref' && + !(state.parseContext.extTagOpts && state.parseContext.extTagOpts.allowNestedRef) + ) { return null; } @@ -57,9 +59,11 @@ Ref.prototype.toDOM = function(state, content, args) { // in-memory DOM which is simply a tree data structure, we can // nest flow content in a tag. wrapperTag: 'sup', - extTag: 'ref', inTemplate: state.parseContext.inTemplate, - allowNestedRef: allowNestedRef, + extTag: 'ref', + extTagOpts: { + allowNestedRef: !!allowNestedRef, + }, noPWrapping: true, noPre: true, });