File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,23 @@ const HTML_RULES_PSEUDO_CLASS_MARKERS = [
242242 ':has-text(' ,
243243] ;
244244
245+ /**
246+ * Checks if the rule should be kept as is,
247+ * i.e. no conversion and no validation,
248+ * since it is not supported by the extension yet.
249+ *
250+ * Conditions for keeping the rule as is:
251+ * - rule is HTML filtering rule
252+ * - rule is AdGuard syntax
253+ * - rule contains pseudo-class marker.
254+ *
255+ * Planned to be fixed:
256+ * https://github.com/AdguardTeam/tsurlfilter/issues/96.
257+ *
258+ * @param {import('@adguard/agtree').AnyRule } ruleNode Rule node to check.
259+ *
260+ * @returns {boolean } True if the rule should be kept as is, otherwise false.
261+ */
245262export const shouldKeepAdgHtmlFilteringRuleAsIs = ( ruleNode ) => {
246263 return ruleNode . type === CosmeticRuleType . HtmlFilteringRule
247264 && ruleNode . syntax === AdblockSyntax . Adg
You can’t perform that action at this time.
0 commit comments