Update to r32375 / bug 11874 -- !important may have whitespace between ! and important
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 24 Mar 2008 18:45:26 +0000 (18:45 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 24 Mar 2008 18:45:26 +0000 (18:45 +0000)
includes/Parser.php
maintenance/parserTests.txt

index 31d9146..86e90ce 100644 (file)
@@ -318,7 +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.
+                       '/&nbsp;(!\s*important)/' => ' \\1', #Beware of CSS magic word !important, bug #11874.
                );
                $text = preg_replace( array_keys($fixtags), array_values($fixtags), $text );
 
index 366aed8..a8ca7d9 100644 (file)
@@ -4547,6 +4547,15 @@ Punctuation: CSS !important (bug 11874)
 
 !!end
 
+!! test
+Punctuation: CSS ! important (bug 11874; with space after)
+!! 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)