Remove Cite-specific flag from parser pipeline options

* Use a generic extTagOpts that is opaque to the core parser
  but the individual extension can inspect.

Change-Id: I4d1331604828d583b820084e00af68232ec767f8
This commit is contained in:
Subramanya Sastry 2018-08-07 08:27:19 -05:00 committed by jenkins-bot
parent d8f4a31efe
commit 1a2b7e796f

View file

@ -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 <sup> tag.
wrapperTag: 'sup',
extTag: 'ref',
inTemplate: state.parseContext.inTemplate,
allowNestedRef: allowNestedRef,
extTag: 'ref',
extTagOpts: {
allowNestedRef: !!allowNestedRef,
},
noPWrapping: true,
noPre: true,
});