From 8e479963846241be538266343e28bb9975dceb8e Mon Sep 17 00:00:00 2001 From: Stanislav Atroschenko Date: Fri, 2 Feb 2024 16:43:51 +0300 Subject: [PATCH] fix docs for both set-attr scriptlets --- src/scriptlets/set-attr.js | 16 +++++++++++----- src/scriptlets/trusted-set-attr.js | 22 ++++++++++++++-------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/scriptlets/set-attr.js b/src/scriptlets/set-attr.js index a27ca40ed..a7f0addce 100644 --- a/src/scriptlets/set-attr.js +++ b/src/scriptlets/set-attr.js @@ -43,16 +43,22 @@ import { * * ```html * - * Some text + *
+ * Another text + * Some text + *
* * - * Some text + *
+ * Another text + * Some text + *
* ``` * * 1. Set attribute without value * * ```adblock - * example.org#%#//scriptlet('set-attr', 'div.class > a.class', 'test-attribute') + * example.org#%#//scriptlet('set-attr', 'a.class', 'test-attribute') * ``` * * ```html @@ -66,7 +72,7 @@ import { * 1. Set attribute value to `TRUE` * * ```adblock - * example.org#%#//scriptlet('set-attr', 'div.class > a.class', 'test-attribute', 'TRUE') + * example.org#%#//scriptlet('set-attr', 'a.class', 'test-attribute', 'TRUE') * ``` * * ```html @@ -80,7 +86,7 @@ import { * 1. Set attribute value to `fAlse` * * ```adblock - * example.org#%#//scriptlet('set-attr', 'div.class > a.class', 'test-attribute', 'fAlse') + * example.org#%#//scriptlet('set-attr', 'a.class', 'test-attribute', 'fAlse') * ``` * * ```html diff --git a/src/scriptlets/trusted-set-attr.js b/src/scriptlets/trusted-set-attr.js index f8c9abe5d..6c7dceb98 100644 --- a/src/scriptlets/trusted-set-attr.js +++ b/src/scriptlets/trusted-set-attr.js @@ -32,21 +32,27 @@ import { * 1. Set attribute by selector * * ```adblock - * example.org#%#//scriptlet('trusted-set-attr', 'div.class > a.class', 'test-attribute', '0') + * example.org#%#//scriptlet('trusted-set-attr', 'div.class > a.class', 'test-attribute', '[true, true]') * ``` * * ```html * - * Some text + *
+ * Another text + * Some text + *
* * - * Some text + *
+ * Another text + * Some text + *
* ``` * * 1. Set attribute without value * * ```adblock - * example.org#%#//scriptlet('trusted-set-attr', 'div.class > a.class', 'test-attribute') + * example.org#%#//scriptlet('trusted-set-attr', 'a.class', 'test-attribute') * ``` * * ```html @@ -60,7 +66,7 @@ import { * 1. Set attribute value to `MTIzNTY=` * * ```adblock - * example.org#%#//scriptlet('trusted-set-attr', 'div.class > a.class', 'test-attribute', 'MTIzNTY=') + * example.org#%#//scriptlet('trusted-set-attr', 'a.class', 'test-attribute', 'MTIzNTY=') * ``` * * ```html @@ -68,13 +74,13 @@ import { * Some text * * - * Some text + * Some text * ``` * * 1. Set attribute value to `{ playback: false }` * * ```adblock - * example.org#%#//scriptlet('trusted-set-attr', 'div.class > a.class', 'test-attribute', '{ playback: false }') + * example.org#%#//scriptlet('trusted-set-attr', 'a.class', 'test-attribute', '{ playback: false }') * ``` * * ```html @@ -82,7 +88,7 @@ import { * Some text * * - * Some text + * Some text * ``` * * @added unknown.