Skip to content

Commit fa7b899

Browse files
committed
add comment for shouldKeepAdgHtmlFilteringRuleAsIs
1 parent d3613c3 commit fa7b899

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/main/utils/workaround.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
*/
245262
export const shouldKeepAdgHtmlFilteringRuleAsIs = (ruleNode) => {
246263
return ruleNode.type === CosmeticRuleType.HtmlFilteringRule
247264
&& ruleNode.syntax === AdblockSyntax.Adg

0 commit comments

Comments
 (0)