From d6e5fcf83d1ae5db8ecfdc866e20f21ea3c488c7 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Sun, 31 Jan 2010 18:26:37 +0000 Subject: [PATCH] (bug 16039) Text disappearing after a bad image --- RELEASE-NOTES | 1 + includes/parser/Parser.php | 2 ++ maintenance/parserTests.txt | 12 ++++++++++++ 3 files changed, 15 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ef773d77d0..01f4756496 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 32ded4b2fa..e5e92e039c 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -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" ); diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 6695973adf..b00df4da86 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -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 +

Foo bar +

Bar foo +

+!! end + TODO: more images -- 2.20.1