You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[**hast**][hast] utility to transform from a DOM tree.
12
+
13
+
## Install
6
14
7
15
[yarn][]:
8
16
9
-
```bash
17
+
```sh
10
18
yarn add hast-util-from-dom
11
19
```
12
20
13
21
[npm][]:
14
22
15
-
```bash
23
+
```sh
16
24
npm install hast-util-from-dom
17
25
```
18
26
19
27
## Usage
20
28
21
-
This utility is similar to [`hast-util-from-parse5`][hast-util-from-parse5], but is intended for browser use and therefore relies on the native DOM API instead of an external parsing library.
29
+
This utility is similar to [`hast-util-from-parse5`][hast-util-from-parse5], but
30
+
is intended for browser use and therefore relies on the native DOM API instead
31
+
of an external parsing library.
22
32
23
33
Say we have the following file, `example.html`:
24
34
@@ -32,7 +42,7 @@ Suppose `example.js` is a bundled version of something like this:
Transform a DOM tree to a [**hast**][hast][*tree*][tree].
61
71
62
-
This works in a similar way to the `parse5` version except that it works directly from the DOM rather than a string of HTML. Consequently, it does not maintain location infomation.
72
+
This works in a similar way to the [`parse5`][hast-util-from-parse5] version
73
+
except that it works directly from the DOM rather than a string of HTML.
74
+
Consequently, it does not maintain [positional info][positional-information].
63
75
64
76
## Contribute
65
77
66
-
See [`contributing.md` in `syntax-tree/hast`][contributing] for ways to get
78
+
See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
67
79
started.
80
+
See [`support.md`][support] for ways to get help.
68
81
69
-
This organisation has a [Code of Conduct][coc]. By interacting with this
70
-
repository, organisation, or community you agree to abide by its terms.
82
+
This project has a [Code of Conduct][coc].
83
+
By interacting with this repository, organisation, or community you agree to
0 commit comments