Index: src/wp-includes/formatting.php
===================================================================
--- src/wp-includes/formatting.php	(revision 30055)
+++ src/wp-includes/formatting.php	(working copy)
@@ -441,7 +441,7 @@
 	$pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee);
 
 	if ( $br ) {
-		$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);
 		$pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks
 		$pee = str_replace('<WPPreserveNewline />', "\n", $pee);
 	}
Index: tests/phpunit/tests/formatting/Autop.php
===================================================================
--- tests/phpunit/tests/formatting/Autop.php	(revision 30053)
+++ tests/phpunit/tests/formatting/Autop.php	(working copy)
@@ -400,4 +400,26 @@
 
 		$this->assertEquals( $expected, trim( wpautop( $content ) ) );
 	}
+
+	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 ) ) );
+	}
+
+	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 ) ) );
+	}
+
 }
Index: tests/phpunit/tests/post/guid.php
===================================================================
