Inserting a post from PHP quietly turned [^\n] into [^n] in a code sample. wp_insert_post and wp_update_post expect slashed data and strip one level of backslashes. Wrap the array in wp_slash():
wp_update_post( wp_slash( array( 'ID' => $id, 'post_content' => $html ) ) );