I’m using this code in my plugin:
helper.allowList(['span.dpg-balloon-text'])
helper.registerPlugin(md => {
md.inline.bbcode.ruler.push('dpgb', {
tag: 'dpgb',
wrap: function (startToken, endToken, tagInfo) {
startToken.tag = endToken.tag = 'span'
startToken.content = endToken.content = ''
startToken.type = "span_open";
endToken.type = "span_close";
startToken.nesting = 1;
endToken.nesting = -1;
startToken.attrs = [['class', 'dpg-balloon-text']].concat(
Object.keys(tagInfo.attrs).map(key => [
`data-dpg-${key}`,
tagInfo.attrs[key]
])
)
}
})
})
The above used to work on both empty and non-empty BBCode tags. But I’ve discovered today that now it only triggers when the BBCode tag has content (such as [dpgb]Some content[/dpgb]
) and fails to trigger when the BBCode tag has non content (such as [dpgb][/dpgb]
). Is it a new design choice?