$content = $post->post_content; with formating

If i get your question correct, you want the post_content formatted like the content put out by the_content, right?

Change your upper code like this:

global $post;
$content = apply_filters('the_content',$post->post_content);

This does everything to your content that would be performed when outputting it by the_content();

If you only want the p and b tags, you can use wpautop($post->post_content) instead.

error code: 523