From 82c7233eb8ed56f006d789040ffb9f8d52ed8641 Mon Sep 17 00:00:00 2001 From: barthc Date: Wed, 20 Mar 2024 18:11:48 +0100 Subject: [PATCH] Fixed an issue where css comment is parsed as a css rule --- class-gwiz-gf-code-chest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class-gwiz-gf-code-chest.php b/class-gwiz-gf-code-chest.php index 79b1bd6..b011d8d 100644 --- a/class-gwiz-gf-code-chest.php +++ b/class-gwiz-gf-code-chest.php @@ -679,7 +679,7 @@ public function prefix_css_selectors( $css, $prefix ) { * Find all CSS selectors, but ignore all `@` rules such as @font-face, @media, etc. as they are * defined globally and not can't be scoped to a certion "parent" selector. */ - return preg_replace_callback('/^\s*(?!@)([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/m', function( $matches ) use ( $prefix ) { + return preg_replace_callback('/^\s*(?!@)([^\r\n,{}\/]+)(,(?=[^}]*{)|\s*{)/m', function( $matches ) use ( $prefix ) { return $prefix . ' ' . trim( $matches[1] ) . $matches[2]; }, $css); }