Skip to content

Commit

Permalink
Update dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Apr 16, 2024
1 parent bdef16b commit 7b46519
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 42 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"c8": "^9.0.0",
"hastscript": "^9.0.0",
"prettier": "^3.0.0",
"remark-cli": "^11.0.0",
"remark-preset-wooorm": "^9.0.0",
"remark-cli": "^12.0.0",
"remark-preset-wooorm": "^10.0.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"xo": "^0.58.0"
Expand Down
82 changes: 42 additions & 40 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`toText(tree[, options])`](#totexttree-options)
* [`Options`](#options)
* [`Whitespace`](#whitespace)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`toText(tree[, options])`](#totexttree-options)
* [`Options`](#options)
* [`Whitespace`](#whitespace)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

Expand Down Expand Up @@ -111,46 +111,46 @@ Get the plain-text value of a node.

###### Parameters

* `tree` ([`Node`][node])
— tree to turn into text
* `options` ([`Options`][api-options], optional)
— configuration
* `tree` ([`Node`][node])
— tree to turn into text
* `options` ([`Options`][api-options], optional)
— configuration

###### Returns

Serialized `tree` (`string`).

###### Algorithm

* if `tree` is a [comment][], returns its `value`
* if `tree` is a [text][], applies normal whitespace collapsing to its
`value`, as defined by the [CSS Text][css] spec
* if `tree` is a [root][] or [element][], applies an algorithm similar to the
`innerText` getter as defined by [HTML][]
* if `tree` is a [comment][], returns its `value`
* if `tree` is a [text][], applies normal whitespace collapsing to its
`value`, as defined by the [CSS Text][css] spec
* if `tree` is a [root][] or [element][], applies an algorithm similar to the
`innerText` getter as defined by [HTML][]

###### Notes

> 👉 **Note**: the algorithm acts as if `tree` is being rendered, and as if
> we’re a CSS-supporting user agent, with scripting enabled.
* if `tree` is an element that is not displayed (such as a `head`), we’ll
still use the `innerText` algorithm instead of switching to `textContent`
* if descendants of `tree` are elements that are not displayed, they are
ignored
* CSS is not considered, except for the default user agent style sheet
* a line feed is collapsed instead of ignored in cases where Fullwidth, Wide,
or Halfwidth East Asian Width characters are used, the same goes for a case
with Chinese, Japanese, or Yi writing systems
* replaced elements (such as `audio`) are treated like non-replaced elements
* if `tree` is an element that is not displayed (such as a `head`), we’ll
still use the `innerText` algorithm instead of switching to `textContent`
* if descendants of `tree` are elements that are not displayed, they are
ignored
* CSS is not considered, except for the default user agent style sheet
* a line feed is collapsed instead of ignored in cases where Fullwidth, Wide,
or Halfwidth East Asian Width characters are used, the same goes for a case
with Chinese, Japanese, or Yi writing systems
* replaced elements (such as `audio`) are treated like non-replaced elements

### `Options`

Configuration (TypeScript type).

##### Fields

* `whitespace` ([`Whitespace`][api-whitespace], default: `'normal'`)
— default whitespace setting to use
* `whitespace` ([`Whitespace`][api-whitespace], default: `'normal'`)
— default whitespace setting to use

### `Whitespace`

Expand Down Expand Up @@ -185,12 +185,14 @@ openings for [cross-site scripting (XSS)][xss] attacks.
## Related
* [`hast-util-to-string`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-to-string)
— get the plain-text value (`textContent`)
* [`hast-util-from-text`](https://github.com/syntax-tree/hast-util-from-text)
— set the plain-text value (`innerText`)
* [`hast-util-from-string`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-from-string)
— set the plain-text value (`textContent`)
* [`hast-util-to-string`
](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-to-string)
— get the plain-text value (`textContent`)
* [`hast-util-from-text`](https://github.com/syntax-tree/hast-util-from-text)
— set the plain-text value (`innerText`)
* [`hast-util-from-string`
](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-from-string)
— set the plain-text value (`textContent`)
## Contribute
Expand Down

0 comments on commit 7b46519

Please sign in to comment.