@@ -55,7 +55,7 @@ also serialize HTML at a higher-level (easier) abstraction.
5555## Install
5656
5757This package is [ ESM only] [ esm ] .
58- In Node.js (version 14.14+ and 16.0 +), install with [ npm] [ ] :
58+ In Node.js (version 16 +), install with [ npm] [ ] :
5959
6060``` sh
6161npm install hast-util-to-html
@@ -107,7 +107,7 @@ Yields:
107107
108108## API
109109
110- This package exports the identifier [ ` toHtml ` ] [ tohtml ] .
110+ This package exports the identifier [ ` toHtml ` ] [ api-to-html ] .
111111There is no default export.
112112
113113### ` toHtml(tree[, options]) `
@@ -118,7 +118,7 @@ Serialize hast as HTML.
118118
119119* ` tree ` ([ ` Node ` ] [ node ] or ` Array<Node> ` )
120120 — tree to serialize
121- * ` options ` ([ ` Options ` ] [ options ] , optional)
121+ * ` options ` ([ ` Options ` ] [ api- options] , optional)
122122 — configuration
123123
124124###### Returns
@@ -136,14 +136,6 @@ How to serialize character references (TypeScript type).
136136Prefer named character references (` & ` ) where possible (` boolean ` , default:
137137` false ` ).
138138
139- ###### ` useShortestReferences `
140-
141- Prefer the shortest possible reference, if that results in less bytes
142- (` boolean ` , default: ` false ` ).
143-
144- > ⚠️ ** Note** : ` useNamedReferences ` can be omitted when using
145- > ` useShortestReferences ` .
146-
147139###### ` omitOptionalSemicolons `
148140
149141Whether to omit semicolons when possible (` boolean ` , default: ` false ` ).
@@ -153,6 +145,14 @@ Whether to omit semicolons when possible (`boolean`, default: `false`).
153145> Omitting semicolons is possible for certain named and numeric references in
154146> some cases.
155147
148+ ###### ` useShortestReferences `
149+
150+ Prefer the shortest possible reference, if that results in less bytes
151+ (` boolean ` , default: ` false ` ).
152+
153+ > ⚠️ ** Note** : ` useNamedReferences ` can be omitted when using
154+ > ` useShortestReferences ` .
155+
156156### ` Options `
157157
158158Configuration (TypeScript type).
@@ -195,7 +195,7 @@ Use “bogus comments” instead of comments to save byes: `<?charlie>` instead
195195###### ` characterReferences `
196196
197197Configure how to serialize character references
198- ([ ` CharacterReferences ` ] [ characterreferences ] , optional).
198+ ([ ` CharacterReferences ` ] [ api-character-references ] , optional).
199199
200200###### ` closeEmptyElements `
201201
@@ -245,15 +245,15 @@ Not used in the SVG space.
245245
246246###### ` quote `
247247
248- Preferred quote to use ([ ` Quote ` ] [ quote ] , default: ` '"' ` ).
248+ Preferred quote to use ([ ` Quote ` ] [ api- quote] , default: ` '"' ` ).
249249
250250###### ` quoteSmart `
251251
252252Use the other quote if that results in less bytes (` boolean ` , default: ` false ` ).
253253
254254###### ` space `
255255
256- Which space the document is in ([ ` Space ` ] [ space ] , default: ` 'html' ` ).
256+ Which space the document is in ([ ` Space ` ] [ api- space] , default: ` 'html' ` ).
257257
258258When an ` <svg> ` element is found in the HTML space, this package already
259259automatically switches to and from the SVG space when entering and exiting it.
@@ -341,15 +341,21 @@ followed by browsers such as Chrome and Firefox.
341341## Types
342342
343343This package is fully typed with [TypeScript][].
344- It exports the additional types [ ` CharacterReferences ` ][characterreferences],
345- [ ` Options ` ][options], [ ` Quote ` ][quote], and [ ` Space ` ][space].
344+ It exports the additional types
345+ [ ` CharacterReferences ` ][api-character-references],
346+ [ ` Options ` ][api-options],
347+ [ ` Quote ` ][api-quote], and
348+ [ ` Space ` ][api-space].
346349
347350## Compatibility
348351
349- Projects maintained by the unified collective are compatible with all maintained
352+ Projects maintained by the unified collective are compatible with maintained
350353versions of Node.js.
351- As of now, that is Node.js 14.14+ and 16.0+.
352- Our projects sometimes work with older versions, but this is not guaranteed.
354+
355+ When we cut a new major release, we drop support for unmaintained versions of
356+ Node.
357+ This means we try to keep the current release line, ` hast -util -to -html @^8 ` ,
358+ compatible with Node.js 12.
353359
354360## Security
355361
@@ -390,9 +396,9 @@ abide by its terms.
390396
391397[downloads]: https://www.npmjs.com/package/hast-util-to-html
392398
393- [size-badge]: https://img.shields.io/bundlephobia/minzip/ hast-util-to-html.svg
399+ [size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q= hast-util-to-html
394400
395- [size]: https://bundlephobia .com/result?p =hast-util-to-html
401+ [size]: https://bundlejs .com/?q =hast-util-to-html
396402
397403[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
398404
@@ -440,12 +446,12 @@ abide by its terms.
440446
441447[xast]: https://github.com/syntax-tree/xast
442448
443- [tohtml ]: #tohtmltree-options
449+ [api-to-html ]: #tohtmltree-options
444450
445- [characterreferences ]: #characterreferences
451+ [api-character-references ]: #characterreferences
446452
447- [options]: #options
453+ [api- options]: #options
448454
449- [space]: #space-1
455+ [api- space]: #space-1
450456
451- [quote]: #quote-1
457+ [api- quote]: #quote-1
0 commit comments