Skip to content

Commit 37a34df

Browse files
committed
Update dev-dependencies
1 parent b9cc928 commit 37a34df

File tree

3 files changed

+92
-98
lines changed

3 files changed

+92
-98
lines changed

lib/index.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,16 @@ function doctype(node, _) {
201201
*/
202202
// eslint-disable-next-line complexity
203203
function element(node, state) {
204-
const props = node.properties || {}
204+
const properties = node.properties || {}
205205
let schema = state.schema
206206
/** @type {XastAttributes} */
207207
const attributes = {}
208208

209-
if (props.xmlns === webNamespaces.html) {
209+
if (properties.xmlns === webNamespaces.html) {
210210
schema = html
211-
} else if (props.xmlns === webNamespaces.svg) {
211+
} else if (properties.xmlns === webNamespaces.svg) {
212212
schema = svg
213-
} else if (props.xmlns) {
213+
} else if (properties.xmlns) {
214214
// We don’t support non-HTML, non-SVG namespaces, so stay in the same.
215215
} else if (schema === html && node.tagName === 'svg') {
216216
schema = svg
@@ -230,10 +230,10 @@ function element(node, state) {
230230
/** @type {string} */
231231
let key
232232

233-
for (key in props) {
234-
if (own.call(props, key)) {
233+
for (key in properties) {
234+
if (own.call(properties, key)) {
235235
const info = find(schema, key)
236-
let value = props[key]
236+
let value = properties[key]
237237

238238
// Ignore nullish, false, and `NaN` values, and falsey known booleans.
239239
if (

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@
4545
"zwitch": "^2.0.0"
4646
},
4747
"devDependencies": {
48-
"@types/node": "^20.0.0",
49-
"c8": "^8.0.0",
50-
"hastscript": "^8.0.0",
48+
"@types/node": "^22.0.0",
49+
"c8": "^10.0.0",
50+
"hastscript": "^9.0.0",
5151
"mdast-util-to-hast": "^13.0.0",
5252
"prettier": "^3.0.0",
53-
"remark-cli": "^11.0.0",
54-
"remark-preset-wooorm": "^9.0.0",
53+
"remark-cli": "^12.0.0",
54+
"remark-preset-wooorm": "^11.0.0",
5555
"type-coverage": "^2.0.0",
5656
"typescript": "^5.0.0",
5757
"unist-builder": "^4.0.0",
5858
"xastscript": "^4.0.0",
59-
"xo": "^0.55.0"
59+
"xo": "^0.60.0"
6060
},
6161
"scripts": {
6262
"prepack": "npm run build && npm run format",

readme.md

+79-85
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
# hast-util-to-xast
22

3-
[![Build][build-badge]][build]
4-
[![Coverage][coverage-badge]][coverage]
5-
[![Downloads][downloads-badge]][downloads]
6-
[![Size][size-badge]][size]
7-
[![Sponsors][sponsors-badge]][collective]
8-
[![Backers][backers-badge]][collective]
9-
[![Chat][chat-badge]][chat]
3+
[![Build][badge-build-image]][badge-build-url]
4+
[![Coverage][badge-coverage-image]][badge-coverage-url]
5+
[![Downloads][badge-downloads-image]][badge-downloads-url]
6+
[![Size][badge-size-image]][badge-size-url]
107

11-
[hast][] (HTML) utility to transform to [xast][] (XML).
8+
[hast][github-hast] (HTML) utility to transform to [xast][github-xast] (XML).
129

1310
## Contents
1411

15-
* [What is this?](#what-is-this)
16-
* [When should I use this?](#when-should-i-use-this)
17-
* [Install](#install)
18-
* [Use](#use)
19-
* [API](#api)
20-
* [`toXast(tree[, options])`](#toxasttree-options)
21-
* [`Options`](#options)
22-
* [`Space`](#space-1)
23-
* [Types](#types)
24-
* [Compatibility](#compatibility)
25-
* [Security](#security)
26-
* [Related](#related)
27-
* [Contribute](#contribute)
28-
* [License](#license)
12+
* [What is this?](#what-is-this)
13+
* [When should I use this?](#when-should-i-use-this)
14+
* [Install](#install)
15+
* [Use](#use)
16+
* [API](#api)
17+
* [`toXast(tree[, options])`](#toxasttree-options)
18+
* [`Options`](#options)
19+
* [`Space`](#space-1)
20+
* [Types](#types)
21+
* [Compatibility](#compatibility)
22+
* [Security](#security)
23+
* [Related](#related)
24+
* [Contribute](#contribute)
25+
* [License](#license)
2926

3027
## What is this?
3128

32-
This package is a utility that takes a [hast][] (HTML) syntax tree as input and
33-
turns it into a [xast][] (XML) syntax tree.
29+
This package is a utility that takes a
30+
[hast][github-hast] (HTML)
31+
syntax tree as input and turns it into a
32+
[xast][github-xast] (XML)
33+
syntax tree.
3434
This package also supports embedded MDX nodes.
3535

3636
## When should I use this?
@@ -41,13 +41,15 @@ One example of this is for EPUB (digital books).
4141

4242
There is no inverse of this utility, because not all XML is HTML.
4343

44-
A similar package, [`hast-util-to-estree`][hast-util-to-estree], can turn
45-
hast into estree (JavaScript) as JSX, which has some similarities to XML.
44+
A similar package, [`hast-util-to-estree`][github-hast-util-to-estree],
45+
can turn hast into estree (JavaScript) as JSX,
46+
which has some similarities to XML.
4647

4748
## Install
4849

49-
This package is [ESM only][esm].
50-
In Node.js (version 16+), install with [npm][]:
50+
This package is [ESM only][github-gist-esm].
51+
In Node.js (version 16+), install with
52+
[npm][npmjs-install]:
5153

5254
```sh
5355
npm install hast-util-to-xast
@@ -56,14 +58,14 @@ npm install hast-util-to-xast
5658
In Deno with [`esm.sh`][esmsh]:
5759

5860
```js
59-
import {toXast} from "https://esm.sh/hast-util-to-xast@3"
61+
import {toXast} from 'https://esm.sh/hast-util-to-xast@3'
6062
```
6163

6264
In browsers with [`esm.sh`][esmsh]:
6365

6466
```html
6567
<script type="module">
66-
import {toXast} from "https://esm.sh/hast-util-to-xast@3?bundle"
68+
import {toXast} from 'https://esm.sh/hast-util-to-xast@3?bundle'
6769
</script>
6870
```
6971

@@ -110,18 +112,18 @@ There is no default export.
110112

111113
### `toXast(tree[, options])`
112114

113-
Turn a [hast][] tree into a [xast][] tree.
115+
Turn a [hast][github-hast] tree into a [xast][github-xast] tree.
114116

115117
###### Parameters
116118

117-
* `tree` ([`HastNode`][hast-node])
118-
— hast tree to transform
119-
* `options` ([`Options`][api-options], optional)
120-
— configuration
119+
* `tree` ([`HastNode`][github-hast-nodes])
120+
— hast tree to transform
121+
* `options` ([`Options`][api-options], optional)
122+
— configuration
121123

122124
###### Returns
123125

124-
xast tree ([`XastNode`][xast-node]).
126+
xast tree ([`XastNode`][github-xast-nodes]).
125127

126128
### `Options`
127129

@@ -168,94 +170,86 @@ compatible with Node.js 16.
168170
## Security
169171
170172
Both HTML and XML can be dangerous languages: don’t trust user-provided data.
171-
Use [`hast-util-santize`][hast-util-sanitize] to make the hast tree safe before
172-
using this utility.
173+
Use [`hast-util-santize`][github-hast-util-sanitize]
174+
to make the hast tree safe before using this utility.
173175
174176
## Related
175177
176-
* [`hastscript`](https://github.com/syntax-tree/hastscript)
177-
— create **[hast][]** (HTML or SVG) trees
178-
* [`xastscript`](https://github.com/syntax-tree/xastscript)
179-
— create **[xast][]** (XML) trees
180-
* [`xast-util-to-xml`](https://github.com/syntax-tree/xast-util-to-xml)
181-
— serialize as XML
178+
* [`hastscript`](https://github.com/syntax-tree/hastscript)
179+
— create [hast][github-hast] (HTML or SVG) trees
180+
* [`xastscript`](https://github.com/syntax-tree/xastscript)
181+
— create [xast][github-xast] (XML) trees
182+
* [`xast-util-to-xml`](https://github.com/syntax-tree/xast-util-to-xml)
183+
— serialize as XML
182184
183185
## Contribute
184186
185-
See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
186-
ways to get started.
187-
See [`support.md`][support] for ways to get help.
187+
See [`contributing.md`][health-contributing]
188+
in
189+
[`syntax-tree/.github`][health]
190+
for ways to get started.
191+
See [`support.md`][health-support] for ways to get help.
188192
189-
This project has a [code of conduct][coc].
193+
This project has a [code of conduct][health-coc].
190194
By interacting with this repository, organization, or community you agree to
191195
abide by its terms.
192196
193197
## License
194198
195-
[MIT][license] © [Titus Wormer][author]
199+
[MIT][file-license] © [Titus Wormer][wooorm]
196200
197201
<!-- Definitions -->
198202
199-
[build-badge]: https://github.com/syntax-tree/hast-util-to-xast/workflows/main/badge.svg
200-
201-
[build]: https://github.com/syntax-tree/hast-util-to-xast/actions
202-
203-
[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/hast-util-to-xast.svg
204-
205-
[coverage]: https://codecov.io/github/syntax-tree/hast-util-to-xast
206-
207-
[downloads-badge]: https://img.shields.io/npm/dm/hast-util-to-xast.svg
203+
[api-options]: #options
208204
209-
[downloads]: https://www.npmjs.com/package/hast-util-to-xast
205+
[api-space]: #space-1
210206
211-
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=hast-util-to-xast
207+
[api-to-xast]: #toxasttree-options
212208
213-
[size]: https://bundlejs.com/?q=hast-util-to-xast
209+
[badge-build-image]: https://github.com/syntax-tree/hast-util-to-xast/workflows/main/badge.svg
214210
215-
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
211+
[badge-build-url]: https://github.com/syntax-tree/hast-util-to-xast/actions
216212
217-
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
213+
[badge-coverage-image]: https://img.shields.io/codecov/c/github/syntax-tree/hast-util-to-xast.svg
218214
219-
[collective]: https://opencollective.com/unified
215+
[badge-coverage-url]: https://codecov.io/github/syntax-tree/hast-util-to-xast
220216
221-
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
217+
[badge-downloads-image]: https://img.shields.io/npm/dm/hast-util-to-xast.svg
222218
223-
[chat]: https://github.com/syntax-tree/unist/discussions
219+
[badge-downloads-url]: https://www.npmjs.com/package/hast-util-to-xast
224220
225-
[npm]: https://docs.npmjs.com/cli/install
221+
[badge-size-image]: https://img.shields.io/bundlejs/size/hast-util-to-xast
226222
227-
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
223+
[badge-size-url]: https://bundlejs.com/?q=hast-util-to-xast
228224
229225
[esmsh]: https://esm.sh
230226
231-
[typescript]: https://www.typescriptlang.org
227+
[file-license]: license
232228
233-
[license]: license
229+
[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
234230
235-
[author]: https://wooorm.com
231+
[github-hast]: https://github.com/syntax-tree/hast
236232
237-
[health]: https://github.com/syntax-tree/.github
238-
239-
[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md
233+
[github-hast-nodes]: https://github.com/syntax-tree/hast#nodes
240234
241-
[support]: https://github.com/syntax-tree/.github/blob/main/support.md
235+
[github-hast-util-sanitize]: https://github.com/syntax-tree/hast-util-sanitize
242236
243-
[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md
237+
[github-hast-util-to-estree]: https://github.com/syntax-tree/hast-util-to-estree
244238
245-
[hast]: https://github.com/syntax-tree/hast
239+
[github-xast]: https://github.com/syntax-tree/xast
246240
247-
[hast-node]: https://github.com/syntax-tree/hast#nodes
241+
[github-xast-nodes]: https://github.com/syntax-tree/xast#nodes
248242
249-
[hast-util-sanitize]: https://github.com/syntax-tree/hast-util-sanitize
243+
[health]: https://github.com/syntax-tree/.github
250244
251-
[hast-util-to-estree]: https://github.com/syntax-tree/hast-util-to-estree
245+
[health-coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md
252246
253-
[xast]: https://github.com/syntax-tree/xast
247+
[health-contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md
254248
255-
[xast-node]: https://github.com/syntax-tree/xast#nodes
249+
[health-support]: https://github.com/syntax-tree/.github/blob/main/support.md
256250
257-
[api-to-xast]: #toxasttree-options
251+
[npmjs-install]: https://docs.npmjs.com/cli/install
258252
259-
[api-options]: #options
253+
[typescript]: https://www.typescriptlang.org
260254
261-
[api-space]: #space-1
255+
[wooorm]: https://wooorm.com

0 commit comments

Comments
 (0)