(bug 16039) Text disappearing after a bad image
authorMax Semenik <maxsem@users.mediawiki.org>
Sun, 31 Jan 2010 18:26:37 +0000 (18:26 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Sun, 31 Jan 2010 18:26:37 +0000 (18:26 +0000)
RELEASE-NOTES
includes/parser/Parser.php
maintenance/parserTests.txt

index ef773d7..01f4756 100644 (file)
@@ -729,6 +729,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Fixed bug involving unclosed "-{" markup in the language converter
 * (bug 21870) No longer include Google logo from an external server on wiki error.
 * (bug 22181) Do not truncate if the ellipsis actually make the string longer
+* (bug 16039) Text disappearing after a bad image
 
 == API changes in 1.16 ==
 
index 32ded4b..e5e92e0 100644 (file)
@@ -1738,6 +1738,8 @@ class Parser
                                                }
                                                # cloak any absolute URLs inside the image markup, so replaceExternalLinks() won't touch them
                                                $s .= $prefix . $this->armorLinks( $this->makeImage( $nt, $text, $holders ) ) . $trail;
+                                       } else {
+                                               $s .= $prefix . $trail;
                                        }
                                        $this->mOutput->addImage( $nt->getDBkey() );
                                        wfProfileOut( __METHOD__."-image" );
index 6695973..b00df4d 100644 (file)
@@ -7751,6 +7751,18 @@ Bad images - basic functionality
 !! result
 !! end
 
+!! test
+Bad images - bug 16039: text after bad image disappears
+!! input
+Foo bar
+[[File:Bad.jpg]]
+Bar foo
+!! result
+<p>Foo bar
+</p><p>Bar foo
+</p>
+!! end
+
 
 TODO:
 more images