Last active
December 21, 2021 18:14
-
-
Save MichaelAllenWarner/fd931eecf07992bd4628ccb525c9359e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/lib/Drupal/Core/Asset/CssOptimizer.php b/core/lib/Drupal/Core/Asset/CssOptimizer.php | |
index 775603b633..93f2220c42 100644 | |
--- a/core/lib/Drupal/Core/Asset/CssOptimizer.php | |
+++ b/core/lib/Drupal/Core/Asset/CssOptimizer.php | |
@@ -189,8 +189,8 @@ protected function processCss($contents, $optimize = FALSE) { | |
if ($optimize) { | |
// Perform some safe CSS optimizations. | |
- // Regexp to match comment blocks. | |
- $comment = '/\*[^*]*\*+(?:[^/*][^*]*\*+)*/'; | |
+ // Regexp to match comment blocks, except for "/*!*/" (so that "/*!*/ /*!*/" is preserved). | |
+ $comment = '/\*(?!!\*/)[^*]*\*+(?:[^/*][^*]*\*+)*/'; | |
// Regexp to match double quoted strings. | |
$double_quot = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"'; | |
// Regexp to match single quoted strings. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment