Skip to content

Commit

Permalink
revert md changes
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-atr committed Jun 5, 2023
1 parent 09ac355 commit b7d95b3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 22 deletions.
26 changes: 15 additions & 11 deletions src/scriptlets/remove-node-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,22 @@ import {
* Related UBO scriptlet:
* https://github.com/gorhill/uBlock/commit/2bb446797a12086f2eebc0c8635b671b8b90c477
*
* **Syntax**
* ```
* ### Syntax
*
* ```adblock
* example.org#%#//scriptlet('remove-node-text', nodeName, condition)
* ```
*
* - `nodeName` — required, string or RegExp, specifies DOM node name from which the text will be removed. Must target lowercased node names,
* e.g `div` instead of `DIV`.
* - `textMatch` — required, string or RegExp to match against node's text content. If matched, the whole text will be removed.
* Case sensitive.
* - `nodeName` — required, string or RegExp, specifies DOM node name from which the text will be removed.
* Must target lowercased node names, e.g `div` instead of `DIV`.
* - `textMatch` — required, string or RegExp to match against node's text content.
* If matched, the whole text will be removed. Case sensitive.
*
* **Examples**
* 1. Remove node's text content:
* ```
* ### Examples
*
* 1. Remove node's text content:
*
* ```adblock
* example.org#%#//scriptlet('remove-node-text', 'div', 'some text')
* ```
*
Expand All @@ -49,8 +52,9 @@ import {
* <span>some text</span>
* ```
*
* 2. Remove node's text content, matching both node name and condition by RegExp:
* ```
* 2. Remove node's text content, matching both node name and condition by RegExp:
*
* ```adblock
* example.org#%#//scriptlet('remove-node-text', '/[a-z]*[0-9]/', '/text/')
* ```
*
Expand Down
26 changes: 15 additions & 11 deletions src/scriptlets/trusted-replace-node-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,24 @@ import {
* Related UBO scriptlet:
* https://github.com/gorhill/uBlock/commit/41876336db48
*
* **Syntax**
* ```
* ### Syntax
*
* ```adblock
* example.org#%#//scriptlet('trusted-replace-node-text', nodeName, condition)
* ```
*
* - `nodeName` — required, string or RegExp, specifies DOM node name from which the text will be removed. Must target lowercased node names,
* e.g `div` instead of `DIV`.
* - `textMatch` — required, string or RegExp to match against node's text content. If matched, the whole text will be removed.
* Case sensitive.
* - `nodeName` — required, string or RegExp, specifies DOM node name from which the text will be removed.
* Must target lowercased node names, e.g `div` instead of `DIV`.
* - `textMatch` — required, string or RegExp to match against node's text content.
* If matched, the whole text will be removed. Case sensitive.
* - `pattern` — required, string or regexp for matching contents of `node.textContent` that should be replaced.
* - `replacement` — required, string to replace text content matched by `pattern`.
*
* **Examples**
* 1. Replace node's text content:
* ```
* ### Examples
*
* 1. Replace node's text content:
*
* ```adblock
* example.org#%#//scriptlet('trusted-replace-node-text', 'div', 'some', 'text', 'other text')
* ```
*
Expand All @@ -53,8 +56,9 @@ import {
* <span>some text</span>
* ```
*
* 2. Replace node's text content, matching both node name, text and pattern by RegExp:
* ```
* 2. Replace node's text content, matching both node name, text and pattern by RegExp:
*
* ```adblock
* example.org#%#//scriptlet('trusted-replace-node-text', '/[a-z]*[0-9]/', '/s\dme/', '/t\dxt/', 'other text')
* ```
*
Expand Down

0 comments on commit b7d95b3

Please sign in to comment.