Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hast-util-to-text

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hast-util-to-text - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

1

lib/index.js

@@ -274,3 +274,2 @@ /**

console.trace('xxx')
return []

@@ -277,0 +276,0 @@ }

6

package.json
{
"name": "hast-util-to-text",
"version": "4.0.1",
"version": "4.0.2",
"description": "hast utility to get the plain-text value of a node according to the `innerText` algorithm",

@@ -47,4 +47,4 @@ "license": "MIT",

"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",

@@ -51,0 +51,0 @@ "typescript": "^5.0.0",

@@ -15,16 +15,16 @@ # hast-util-to-text

* [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)

@@ -115,6 +115,6 @@ ## What is this?

* `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

@@ -127,7 +127,7 @@ ###### Returns

* 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][]

@@ -139,11 +139,11 @@ ###### Notes

* 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

@@ -156,4 +156,4 @@ ### `Options`

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

@@ -193,8 +193,10 @@ ### `Whitespace`

* [`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`)

@@ -201,0 +203,0 @@ ## Contribute

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc