I think this is the result of wpautop
filter running on the_content
. You can remove this filter from the content:
remove_filter('the_content', 'wpautop');
// OR if the above line does not work:
add_filter('the_content', 'remove_autop', 1);
function remove_autop($content) {
remove_filter(current_filter(), 'wpautop');
return $content;
}
Or you can use shortcode_unautop
filter, but this will only work if your shortcode is stand alone with no other content in the text editor:
add_filter('the_content', 'shortcode_unautop');