impore path modifier descr for non-basic rules. #1071

This commit is contained in:
Slava Leleka 2022-10-26 19:10:24 +03:00
parent d8e3e1ba6a
commit b6fd28dad0
2 changed files with 10 additions and 5 deletions

View File

@ -2315,13 +2315,14 @@ But rules with mixed style domains restriction are considered invalid. So, for e
#### Syntax
```
path=pattern
$path ["=" pattern]
```
`pattern` is a path mask to which the rule is restricted. Its syntax and behavior are pretty much the same as with the [pattern for basic rules](#basic-rules-syntax). You can also use [special characters](#basic-rules-special-characters), except for `||`, which does not make any sense in this case (see examples below).
`pattern` — optional, a path mask to which the rule is restricted. Its syntax and behavior are pretty much the same as with the [pattern for basic rules](#basic-rules-syntax). You can also use [special characters](#basic-rules-special-characters), except for `||`, which does not make any sense in this case (see examples below). If not set, rule will apply only on the main page of website.
> If `pattern` is not set for `$path`, rule will apply only on the main page of website.
> Please note that `path` modifier matches the query string as well.
> Please note that `$path` modifier matches the query string as well.
> `$path` modifier supports regular expressions in [the same way](#regexp-support) basic rules do.
@ -2331,6 +2332,7 @@ path=pattern
* `[$path=|/page.html]##.textad` — hides a `div` with a class `textad` at `/page.html` or `/page.html?<query>` of any domain but not at `/sub/page.html`
* `[$path=/page.html|]##.textad` — hides a `div` with a class `textad` at `/page.html` or `/sub/page.html` of any domain but not at `/page.html?<query>`
* `[$path=/page*.html]example.com##.textad` — hides a `div` with a class `textad` at `/page1.html` or `/page2.html` or any other path matching `/page<...>.html` of `example.com`
* `[$path]example.com##.textad` — hides a `div` with a class `textad` at the main page of `example.com`
* `[$domain=example.com,path=/page.html]##.textad` — hides a `div` with a class `textad` at `page.html` of `example.com` and all subdomains but not at `another_page.html`
* `[$path=/\\/(sub1|sub2)\\/page\\.html/]##.textad` — hides a `div` with a class `textad` at both `/sub1/page.html` and `/sub2/page.html` of any domain (please, note the [escaped special characters](#non-basic-rules-modifiers-syntax))

View File

@ -2296,10 +2296,12 @@ modifiers = modifier0[, modifier1[, ...[, modifierN]]]
#### Синтаксис
```
path=pattern
$path ["=" pattern]
```
`pattern` — это маска пути, которой ограничено правило. Его синтаксис и поведение почти такие же, как в [шаблоне базовых правил](#basic-rules-syntax). Вы также можете использовать [специальные символы](#basic-rules-special-characters), за исключением `||`, поскольку в этом случае это не имеет никакого смысла (см. примеры ниже).
`pattern` — необязательный, это маска пути, которой ограничено правило. Его синтаксис и поведение почти такие же, как в [шаблоне базовых правил](#basic-rules-syntax). Вы также можете использовать [специальные символы](#basic-rules-special-characters), за исключением `||`, поскольку в этом случае это не имеет никакого смысла (см. примеры ниже).
> Если `pattern` не указан для модификатора `$path`, правило применится только на главной странице сайта.
> Обратите внимание, что модификатор пути также соответствует параметрам запроса.
@ -2311,6 +2313,7 @@ path=pattern
* `[$path=|/page.html]##.textad` — скрывает `div` с классом `textad` на `/page.html` или `/page.html?<query>` любого домена, но не на `/sub/page.html`
* `[$path=/page.html|]##.textad` — скрывает `div` с классом `textad` на `/page.html` или `/sub/page.html` любого домена, но не на `/page.html?<query>`
* `[$path=/page*.html]example.com##.textad` — скрывает `div` с классом `textad` на `/page1.html`, `/page2.html` или любом другом пути, соответствующим `/page<...>.html`, на домене `example.com`
* `[$path]example.com##.textad` — скрывает `div` с классом `textad` на главной странице сайта `example.com`
* `[$domain=example.com,path=/page.html]##.textad` — скрывает `div` с классом `textad` на `page.html` домена `example.com` и всех его поддоменах, но не на `another_page.html`
* `[$path=/\\/(sub1|sub2)\\/page\\.html/]##.textad` — скрывает `div` с классом `textad` как на `/sub1/page.html`, так и `/sub2/page.html` любого домена (обратите внимание на [экранированные символы](#non-basic-rules-modifiers-syntax))