diff --git a/tests/phpunit/tests/post/filtering.php b/tests/phpunit/tests/post/filtering.php
index 57c4ed7..fff1b20 100644
--- a/tests/phpunit/tests/post/filtering.php
+++ b/tests/phpunit/tests/post/filtering.php
@@ -90,6 +90,106 @@ EOF;
 		$this->assertEquals( $expected, $post->post_content );
 	}
 
+	/**
+	 * make sure unbalanced tags are fixed when they span a --more-- tag
+	 * @ticket 6297
+	 */
+	function test_post_content_unbalanced_more() {
+		$content = <<<EOF
+<em>some text<!--more-->
+that's continued after the jump</em>
+EOF;
+
+		$expected = <<<EOF
+<em>some text</em><!--more-->
+that's continued after the jump
+EOF;
+
+		$id = $this->factory->post->create( array( 'post_content' => $content ) );
+		$post = get_post($id);
+
+		$this->assertEquals( $expected, $post->post_content );
+	}
+
+	/**
+	 * make sure unbalanced tags are fixed when they span a --nextpage-- tag
+	 * @ticket 6297
+	 */
+	function test_post_content_unbalanced_nextpage() {
+		$content = <<<EOF
+<em>some text<!--nextpage-->
+that's continued after the jump</em>
+EOF;
+
+		$expected = <<<EOF
+<em>some text</em><!--nextpage-->
+that's continued after the jump
+EOF;
+
+		$id = $this->factory->post->create( array( 'post_content' => $content ) );
+		$post = get_post($id);
+
+		$this->assertEquals( $expected, $post->post_content );
+	}
+
+	/**
+	 * make sure unbalanced tags are fixed when they span both --more-- and --nextpage-- tags (in that order)
+	 * @ticket 6297
+	 */
+	function test_post_content_unbalanced_more_nextpage() {
+		$content = <<<EOF
+<em>some text<!--more-->
+that's continued after the jump</em>
+<!--nextpage-->
+<p>and the next page
+<!--nextpage-->
+breaks the graf</p>
+EOF;
+
+		$expected = <<<EOF
+<em>some text</em><!--more-->
+that's continued after the jump
+<!--nextpage-->
+<p>and the next page
+</p><!--nextpage-->
+breaks the graf
+EOF;
+
+		$id = $this->factory->post->create( array( 'post_content' => $content ) );
+		$post = get_post($id);
+
+		$this->assertEquals( $expected, $post->post_content );
+	}
+
+	/**
+	 * make sure unbalanced tags are fixed when they span both --nextpage-- and --more-- tags (in that order)
+	 * @ticket 6297
+	 */
+	function test_post_content_unbalanced_nextpage_more() {
+		$content = <<<EOF
+<em>some text<!--nextpage-->
+that's continued after the jump</em>
+<!--more-->
+<p>and the next page
+<!--nextpage-->
+breaks the graf</p>
+EOF;
+
+		$expected = <<<EOF
+<em>some text</em><!--nextpage-->
+that's continued after the jump
+<!--more-->
+<p>and the next page
+</p><!--nextpage-->
+breaks the graf
+EOF;
+
+		$id = $this->factory->post->create( array( 'post_content' => $content ) );
+		$post = get_post($id);
+
+		$this->assertEquals( $expected, $post->post_content );
+	}
+
 	// make sure unbalanced tags are untouched when the balance option is off
 	function test_post_content_nobalance_nextpage_more() {
 
