Index: includes/parser/StripState.php
===================================================================
--- includes/parser/StripState.php	(revision 99017)
+++ includes/parser/StripState.php	(working copy)
@@ -48,7 +48,7 @@
 			throw new MWException( "Invalid marker: $marker" );
 		}
 
-		$this->data[$type][$m[1]] = $value;
+		$this->data[$type][$m[1]] = $this->unstripBoth( $value );
 	}
 
 	/**
@@ -155,9 +155,15 @@
 	function merge( $otherState, $texts ) {
 		$mergePrefix = Parser::getRandomString();
 
+		foreach ( $this->data as $type => $items ) {
+			foreach ( $items as $key => $value ) {
+				$this->data[$type][$key] = $otherState->unstripBoth( $value );
+			}
+		}
+
 		foreach ( $otherState->data as $type => $items ) {
 			foreach ( $items as $key => $value ) {
-				$this->data[$type]["$mergePrefix-$key"] = $value;
+				$this->data[$type]["$mergePrefix-$key"] = $this->unstripBoth( $value );
 			}
 		}
 
