# Markdown-Erweiterung: Inline-Wrap-Funktionen erkennen BBCode-Tags mit leerem Inhalt nicht mehr

**URL:** <https://meta.discourse.org/t/markdown-extension-inline-wrap-functions-doesnt-recognize-bbcode-tags-with-empty-content-anymore/238894>\
**Category:** Bug\
**Tags:** development\
**Created:** [13. September 2022 um 16:25 UTC](https://meta.discourse.org/t/markdown-extension-inline-wrap-functions-doesnt-recognize-bbcode-tags-with-empty-content-anymore/238894 "2022-09-13T16:25:12Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![syl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/syl/32/98883_2.png) [@syl](https://meta.discourse.org/u/syl)\
**Post date:** [13. September 2022 um 16:25 UTC](https://meta.discourse.org/t/markdown-extension-inline-wrap-functions-doesnt-recognize-bbcode-tags-with-empty-content-anymore/238894/1 "2022-09-13T16:25:12Z")

</div>

Ich verwende diesen Code in meinem Plugin:

```javascript
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]
        ])
      )
    }
  })
})

```

Das oben hat früher sowohl bei leeren als auch bei nicht leeren BBCode-Tags funktioniert. Aber ich habe heute festgestellt, dass es jetzt nur noch ausgelöst wird, wenn der BBCode-Tag Inhalt hat (wie z.B. `[dpgb]Einige Inhalte[/dpgb]`) und nicht ausgelöst wird, wenn der BBCode-Tag keinen Inhalt hat (wie z.B. `[dpgb][/dpgb]`). Ist das eine neue Designentscheidung?

---

_[View the full topic](https://meta.discourse.org/t/markdown-extension-inline-wrap-functions-doesnt-recognize-bbcode-tags-with-empty-content-anymore/238894)._
