* (bug 11874) Inline CSS with !important no longer borken
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 24 Mar 2008 18:32:26 +0000 (18:32 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 24 Mar 2008 18:32:26 +0000 (18:32 +0000)
Patch by Nicolas Dumazet - https://bugzilla.wikimedia.org/attachment.cgi?id=4754
Plus parser test case

RELEASE-NOTES
includes/Parser.php
maintenance/parserTests.txt

index 40addaa..dbb4125 100644 (file)
@@ -125,6 +125,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 6892, 7147) Trackback error handling, optional fields more robust
 * (bug 6813) Don't break HTML validator when using trackbacks
 * Fix for size checks on SVG images with global 'stroke-width' attribute
+* (bug 11874) Inline CSS with !important no longer borken
 
 
 === API changes in 1.13 ===
index 7215ca5..31d9146 100644 (file)
@@ -318,6 +318,7 @@ class Parser
                        '/(.) (?=\\?|:|;|!|%|\\302\\273)/' => '\\1&nbsp;\\2',
                        # french spaces, Guillemet-right
                        '/(\\302\\253) /' => '\\1&nbsp;',
+                       '/&nbsp;(!important)/' => ' \\1', #Beware of CSS magic word !important, bug #11874.
                );
                $text = preg_replace( array_keys($fixtags), array_values($fixtags), $text );
 
index 2e72415..366aed8 100644 (file)
@@ -4529,6 +4529,25 @@ Self closed html pairs (bug 5487)
 #
 #
 
+!! test
+Punctuation: nbsp before exclamation
+!! input
+C'est grave !
+!! result
+<p>C'est grave&nbsp;!
+</p>
+!! end
+
+!! test
+Punctuation: CSS !important (bug 11874)
+!! input
+<div style="width:50% !important">important</div>
+!! result
+<div style="width:50% !important">important</div>
+
+!!end
+
+
 !! test
 HTML bullet list, closed tags (bug 5497)
 !! input