The <br />
tags are being added to the content by the wpautop()
function. If you run your shortcode before it runs they will not be there. It is added in \wp-includes\default-filters.php
with the default priority of 10
.
add_filter( 'the_content', 'myshortcode', 1 );
function myshortcode( $atts, $content = null ) {
return $content;
}
wpautop() can also add other markup besides <br />
tags.