Detect incorrect system font stack inserted in Chrome
authorAlexander Ebert <ebert@woltlab.com>
Tue, 2 Aug 2022 15:46:46 +0000 (17:46 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 2 Aug 2022 15:46:46 +0000 (17:46 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabClean.js

index 81d1be11b8064727ef3b94a76d86df20d127e790..c1dbf87e22d1f127f234f0467e78c2a4a2956f1c 100644 (file)
@@ -749,6 +749,13 @@ $.Redactor.prototype.WoltLabClean = function() {
 
                                                if (parentStyle === value) {
                                                        removeElements.push(element);
+                                               } else {
+                                                       // Chrome is especially bad when it comes to handling the system
+                                                       // font stack and injects arbitrary fonts that would normally not
+                                                       // be present.
+                                                       if (/\bsystem-ui\b/.test(parentStyle) && /\bsystem-ui\b/.test(value)) {
+                                                               removeElements.push(element);
+                                                       }
                                                }
                                        }
                                });