diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
index e2c8aef269..be27b07ca6 100644
--- a/src/wp-includes/formatting.php
+++ b/src/wp-includes/formatting.php
@@ -580,7 +580,7 @@ function wpautop( $pee, $br = true ) {
 	// Optionally insert line breaks.
 	if ( $br ) {
 		// Replace newlines that shouldn't be touched with a placeholder.
-		$pee = preg_replace_callback( '/<(script|style).*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee );
+		$pee = preg_replace_callback( '/<(script|style|svg).*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee );
 
 		// Normalize <br>
 		$pee = str_replace( array( '<br>', '<br/>' ), '<br />', $pee );
diff --git a/tests/phpunit/tests/formatting/Autop.php b/tests/phpunit/tests/formatting/Autop.php
index 405b68ad34..e93e826695 100644
--- a/tests/phpunit/tests/formatting/Autop.php
+++ b/tests/phpunit/tests/formatting/Autop.php
@@ -566,4 +566,38 @@ line 2<br/>
 
 		$this->assertEquals( $expected, trim( wpautop( $content ) ) );
 	}
+
+	/**
+	 * wpautop() should ignore inline SVG graphics
+	 *
+	 * @ticket 9437
+	 */
+	function test_that_wpautop_ignores_inline_svgs() {
+		$content =
+			'<svg xmlns="http://www.w3.org/2000/svg">
+				<circle cx="50" cy="50" r="30" fill="blue">
+					<animateTransform attributeName="transform" type="scale" to="1.5" dur="2s" fill="freeze"/>
+				</circle>
+			</svg>';
+
+		$expected = '<p>' . $content . '</p>';
+
+		$this->assertEquals( $expected, trim( wpautop( $content ) ) );
+	}
+
+	/**
+	 * wpautop() should ignore inline scripts
+	 *
+	 * @ticket 9437
+	 */
+	function test_that_wpautop_ignores_inline_scripts() {
+		$content =
+			'<script type="text/javascript">
+				var dummy = 1;
+			</script>';
+
+		$expected = '<p>' . $content . '</p>';
+
+		$this->assertEquals( $expected, trim( wpautop( $content ) ) );
+	}
 }
