Commenting out in HTML editor breaks template

My last comment reminded me about shortcodes, and lead me to this answer:

function htmlcomment_shortcode( $atts, $content = null ) {
   return '<!-- ' . $content . ' -->';
}
add_shortcode( 'htmlcomment', 'htmlcomment_shortcode' );

Add that to functions.php or your plugin, and then use it in your content like this:

normal text [htmlcomment]commented out text[/htmlcomment]