I have made a custom popup tiny mce button to add source code.This put shortcode like this
[source]
<h1>Hi</h1>
[/source]
To capture output I used
function caption_shortcode( $atts, $content = null ) {
$content = do_shortcode($content);
return '<span itemprop="articleSection">'.wpautop($content).'</span>';
}
add_shortcode( 'source', 'caption_shortcode' );
This doesn't show <h1>Hi</h1>
rather it convert h1 html tag.How can I make this show like <h1>Hi</h1>
?
wpautop()
is used to replace line breaks with paragraphs? And that would make the HTML perfectly invalid.