From 2e2647203fc1c0703455cd426d2fac4295c4c8c7 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 24 Mar 2008 18:32:26 +0000 Subject: [PATCH] * (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 --- RELEASE-NOTES | 1 + includes/Parser.php | 1 + maintenance/parserTests.txt | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+) 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 -- 2.20.1