Skip to content

Commit 700bede

Browse files
committed
Add improved docs
1 parent 006be2a commit 700bede

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import {convertElement} from 'hast-util-is-element'
66

77
/**
8-
* Check if a node is a embedded content.
8+
* Check if a node is a *embedded content*.
99
*
1010
* @type {import('hast-util-is-element').AssertPredicate<Element & {tagName: 'audio' | 'canvas' | 'embed' | 'iframe' | 'img' | 'math' | 'object' | 'picture' | 'svg' | 'video'}>}
1111
* @param value

readme.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![Backers][backers-badge]][collective]
99
[![Chat][chat-badge]][chat]
1010

11-
[hast][] utility to check if a node is [*embedded*][spec].
11+
[hast][] utility to check if a node is [*embedded content*][spec].
1212

1313
## Contents
1414

@@ -17,7 +17,7 @@
1717
* [Install](#install)
1818
* [Use](#use)
1919
* [API](#api)
20-
* [`embedded(node)`](#embeddednode)
20+
* [`embedded(value)`](#embeddedvalue)
2121
* [Types](#types)
2222
* [Compatibility](#compatibility)
2323
* [Security](#security)
@@ -38,7 +38,7 @@ looking for!
3838
## Install
3939

4040
This package is [ESM only][esm].
41-
In Node.js (version 12.20+, 14.14+, 16.0+, or 18.0+), install with [npm][]:
41+
In Node.js (version 14.14+ and 16.0+), install with [npm][]:
4242

4343
```sh
4444
npm install hast-util-embedded
@@ -82,20 +82,24 @@ embedded({
8282

8383
## API
8484

85-
This package exports the following identifiers: `embedded`.
85+
This package exports the identifier [`embedded`][embedded].
8686
There is no default export.
8787

88-
### `embedded(node)`
88+
### `embedded(value)`
8989

90-
Check if `node` is an [*embedded*][spec] [*element*][element].
90+
Check if `node` is an [*embedded content*][spec].
9191

9292
###### Parameters
9393

94-
* `node` ([`Node`][node]) — node to check
94+
* `value` (`unknown`)
95+
— thing to check (typically [`Node`][node])
9596

9697
###### Returns
9798

98-
Whether `node` is embedded content (`boolean`).
99+
Whether `value` is an element considered embedded content (`boolean`).
100+
101+
The elements `audio`, `canvas`, `embed`, `iframe`, `img`, `math`,
102+
`object`, `picture`, `svg`, and `video` are embedded content.
99103

100104
## Types
101105

@@ -106,7 +110,7 @@ It exports no additional types.
106110

107111
Projects maintained by the unified collective are compatible with all maintained
108112
versions of Node.js.
109-
As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18.0+.
113+
As of now, that is Node.js 14.14+ and 16.0+.
110114
Our projects sometimes work with older versions, but this is not guaranteed.
111115

112116
## Security
@@ -215,6 +219,6 @@ abide by its terms.
215219

216220
[node]: https://github.com/syntax-tree/hast#nodes
217221

218-
[element]: https://github.com/syntax-tree/hast#element
219-
220222
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
223+
224+
[embedded]: #embeddedvalue

0 commit comments

Comments
 (0)