From: Brion Vibber Date: Mon, 24 Mar 2008 18:32:26 +0000 (+0000) Subject: * (bug 11874) Inline CSS with !important no longer borken X-Git-Tag: 1.31.0-rc.0~48848 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=2e2647203fc1c0703455cd426d2fac4295c4c8c7;p=lhc%2Fweb%2Fwiklou.git * (bug 11874) Inline CSS with !important no longer borken Patch by Nicolas Dumazet - https://bugzilla.wikimedia.org/attachment.cgi?id=4754 Plus parser test case --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 40addaa1dc..dbb412563b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/Parser.php b/includes/Parser.php index 7215ca5967..31d91462f4 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -318,6 +318,7 @@ class Parser '/(.) (?=\\?|:|;|!|%|\\302\\273)/' => '\\1 \\2', # french spaces, Guillemet-right '/(\\302\\253) /' => '\\1 ', + '/ (!important)/' => ' \\1', #Beware of CSS magic word !important, bug #11874. ); $text = preg_replace( array_keys($fixtags), array_values($fixtags), $text ); diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 2e72415c81..366aed8997 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -4529,6 +4529,25 @@ Self closed html pairs (bug 5487) # # +!! test +Punctuation: nbsp before exclamation +!! input +C'est grave ! +!! result +

C'est grave ! +

+!! end + +!! test +Punctuation: CSS !important (bug 11874) +!! input +
important
+!! result +
important
+ +!!end + + !! test HTML bullet list, closed tags (bug 5497) !! input