WordPress wraps span tags into p tags

I have investigated this problem and recognized that it is not the TinyMCE fault, but the issue is caused by the the hook function wpautop instead. And tags are wrapped just before post is being displayed.
So in order to fix this issue just remove the hook function like that.

   remove_filter( 'the_content', 'wpautop' );

This could be done for example in your functions.php file.

error code: 523