wp-markdown-editor icon indicating copy to clipboard operation
wp-markdown-editor copied to clipboard

Using with shortcodes

Open cezarsmpio opened this issue 8 years ago • 0 comments

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: captura de tela 2016-10-14 as 10 59 02

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');

cezarsmpio avatar Oct 14 '16 13:10 cezarsmpio