Skip to content

Using with shortcodes #13

@cezarsmpio

Description

@cezarsmpio

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions