wp-markdown-editor
wp-markdown-editor copied to clipboard
Using with shortcodes
Hi guys, I'm trying to use shortcodes inside markdown, in a first way, it's working very well, but if I try execute this code, take a look:
### Code example
[tabs]
[tab label="curl"]
```language-javascript
var a = 'foo';
```
[/tab]
[tab label="Node.js"]
```language-javascript
var b = 'bar';
```
[/tab]
[/tabs]
My result is:
My shortcodes:
// Tabs
function tabs($attrs, $content = null) {
return '<nav class="tab">' . do_shortcode($content) . '</nav>';
}
add_shortcode('tabs', 'tabs');
function tab($attrs, $content = null) {
return '
<a href="#" data-tab="#" class="tab__anchor">' . $attrs['label'] . '</a>
<section class="tab__content">' . $content . '</section>
';
}
add_shortcode('tab', 'tab');