Detect `!important;` as CSS in HtmlOutputNodePre
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 16 Jul 2019 13:58:04 +0000 (15:58 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 16 Jul 2019 13:58:04 +0000 (15:58 +0200)
wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodePre.class.php

index 1cb32626f59792e543e281e6f5204a65da4ae4c8..94f71c5cb0331a7ee19c6cccb865a090dd756836 100644 (file)
@@ -145,6 +145,9 @@ class HtmlOutputNodePre extends AbstractHtmlOutputNode {
                        else if (mb_strpos($content, '\\documentclass') !== false) {
                                $highlighter = 'latex';
                        }
+                       else if (mb_strpos($content, '!important;') !== false) {
+                               $highlighter = 'css';
+                       }
                }
                $eventData = [
                        'highlighter' => $highlighter,