{"id":13452253,"url":"https://github.com/syntax-tree/hast","last_synced_at":"2026-02-03T19:14:19.856Z","repository":{"id":43405179,"uuid":"42365050","full_name":"syntax-tree/hast","owner":"syntax-tree","description":"Hypertext Abstract Syntax Tree format","archived":false,"fork":false,"pushed_at":"2025-02-17T12:10:33.000Z","size":216,"stargazers_count":876,"open_issues_count":0,"forks_count":28,"subscribers_count":15,"default_branch":"main","last_synced_at":"2026-01-29T21:27:41.536Z","etag":null,"topics":["ast","html","hypertext","syntax-tree","unist"],"latest_commit_sha":null,"homepage":"https://unifiedjs.com","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/syntax-tree.png","metadata":{"funding":{"github":"unifiedjs","open_collective":"unified","thanks_dev":"u/gh/syntax-tree"},"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-12T16:53:45.000Z","updated_at":"2026-01-27T03:16:35.000Z","dependencies_parsed_at":"2024-01-13T18:31:41.995Z","dependency_job_id":"8eba1c38-78de-442c-9c74-393eb35551fa","html_url":"https://github.com/syntax-tree/hast","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/syntax-tree/hast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fhast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fhast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fhast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fhast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syntax-tree","download_url":"https://codeload.github.com/syntax-tree/hast/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syntax-tree%2Fhast/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29054202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T15:43:47.601Z","status":"ssl_error","status_checked_at":"2026-02-03T15:43:46.709Z","response_time":96,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ast","html","hypertext","syntax-tree","unist"],"created_at":"2024-07-31T07:01:18.459Z","updated_at":"2026-02-03T19:14:18.299Z","avatar_url":"https://github.com/syntax-tree.png","language":null,"readme":"\u003c!--lint disable no-html--\u003e\n\n# ![hast][github-hast-logo]\n\n**H**ypertext **A**bstract **S**yntax **T**ree format.\n\n***\n\n**hast** is a specification for representing [HTML][whatwg-html]\n(and embedded [SVG][w3c-svg] or [MathML][w3c-mathml])\nas an abstract syntax tree.\nIt implements the **[unist][github-unist]** spec.\n\nThis document may not be released.\nSee [releases][github-hast-releases] for released documents.\nThe latest released version is [`2.4.0`][github-hast-release].\n\n## Contents\n\n* [Introduction](#introduction)\n  * [Where this specification fits](#where-this-specification-fits)\n  * [Virtual DOM](#virtual-dom)\n* [Types](#types)\n* [Nodes (abstract)](#nodes-abstract)\n  * [`Literal`](#literal)\n  * [`Parent`](#parent)\n* [Nodes](#nodes)\n  * [`Comment`](#comment)\n  * [`Doctype`](#doctype)\n  * [`Element`](#element)\n  * [`Root`](#root)\n  * [`Text`](#text)\n* [Other types](#other-types)\n  * [`Properties`](#properties)\n  * [`PropertyName`](#propertyname)\n  * [`PropertyValue`](#propertyvalue)\n* [Glossary](#glossary)\n* [List of utilities](#list-of-utilities)\n* [Related HTML utilities](#related-html-utilities)\n* [References](#references)\n* [Security](#security)\n* [Related](#related)\n* [Contribute](#contribute)\n* [Acknowledgments](#acknowledgments)\n* [License](#license)\n\n## Introduction\n\nThis document defines a format for representing hypertext as an\n[abstract syntax tree][github-unist-syntax-tree].\nDevelopment of hast started in April 2016 for [rehype][github-rehype].\nThis specification is written in a [Web IDL][whatwg-webidl]-like grammar.\n\n### Where this specification fits\n\nhast extends [unist][github-unist],\na format for syntax trees,\nto benefit from its [ecosystem of utilities][github-unist-utilities].\n\nhast relates to [JavaScript][ecma-javascript] in that it has an\n[ecosystem of utilities][section-utilities]\nfor working with compliant syntax trees in JavaScript.\nHowever,\nhast is not limited to JavaScript and can be used in other programming\nlanguages.\n\nhast relates to the [unified][github-unified] and [rehype][github-rehype]\nprojects in that hast syntax trees are used throughout their ecosystems.\n\n### Virtual DOM\n\nThe reason for introducing a new “virtual” DOM is primarily:\n\n* The [DOM][whatwg-dom] is very heavy to implement outside of the browser,\n  a lean and stripped down virtual DOM can be used everywhere\n* Most virtual DOMs do not focus on ease of use in transformations\n* Other virtual DOMs cannot represent the syntax of HTML in its entirety\n  (think comments and document types)\n* Neither the DOM nor virtual DOMs focus on positional information\n\n## Types\n\nIf you are using TypeScript,\nyou can use the hast types by installing them with npm:\n\n```sh\nnpm install @types/hast\n```\n\n## Nodes (abstract)\n\n### `Literal`\n\n```idl\ninterface Literal \u003c: UnistLiteral {\n  value: string\n}\n```\n\n**Literal** (**[UnistLiteral][dfn-unist-literal]**) represents a node in hast\ncontaining a value.\n\n### `Parent`\n\n```idl\ninterface Parent \u003c: UnistParent {\n  children: [Comment | Doctype | Element | Text]\n}\n```\n\n**Parent** (**[UnistParent][dfn-unist-parent]**) represents a node in hast\ncontaining other nodes (said to be *[children][term-child]*).\n\nIts content is limited to only other hast content.\n\n## Nodes\n\n### `Comment`\n\n```idl\ninterface Comment \u003c: Literal {\n  type: 'comment'\n}\n```\n\n**Comment** (**[Literal][dfn-literal]**) represents a [Comment][concept-comment]\n([\\[DOM\\]][whatwg-dom]).\n\nFor example,\nthe following HTML:\n\n```html\n\u003c!--Charlie--\u003e\n```\n\nYields:\n\n```js\n{type: 'comment', value: 'Charlie'}\n```\n\n### `Doctype`\n\n```idl\ninterface Doctype \u003c: Node {\n  type: 'doctype'\n}\n```\n\n**Doctype** (**[Node][dfn-unist-node]**) represents a\n[DocumentType][concept-documenttype] ([\\[DOM\\]][whatwg-dom]).\n\nFor example,\nthe following HTML:\n\n```html\n\u003c!doctype html\u003e\n```\n\nYields:\n\n```js\n{type: 'doctype'}\n```\n\n### `Element`\n\n```idl\ninterface Element \u003c: Parent {\n  type: 'element'\n  tagName: string\n  properties: Properties\n  content: Root?\n  children: [Comment | Element | Text]\n}\n```\n\n**Element** (**[Parent][dfn-parent]**) represents an [Element][concept-element]\n([\\[DOM\\]][whatwg-dom]).\n\nA `tagName` field must be present.\nIt represents the element’s [local name][concept-local-name]\n([\\[DOM\\]][whatwg-dom]).\n\nThe `properties` field represents information associated with the element.\nThe value of the `properties` field implements the\n**[Properties][dfn-properties]** interface.\n\nIf the `tagName` field is `'template'`,\na `content` field can be present.\nThe value of the `content` field implements the **[Root][dfn-root]** interface.\n\nIf the `tagName` field is `'template'`,\nthe element must be a *[leaf][term-leaf]*.\n\nIf the `tagName` field is `'noscript'`,\nits *[children][term-child]* should be represented as if\n*[scripting is disabled][concept-scripting]* ([\\[HTML\\]][whatwg-html]).\n\nFor example,\nthe following HTML:\n\n```html\n\u003ca href=\"https://alpha.com\" class=\"bravo\" download\u003e\u003c/a\u003e\n```\n\nYields:\n\n```js\n{\n  type: 'element',\n  tagName: 'a',\n  properties: {\n    href: 'https://alpha.com',\n    className: ['bravo'],\n    download: true\n  },\n  children: []\n}\n```\n\n### `Root`\n\n```idl\ninterface Root \u003c: Parent {\n  type: 'root'\n}\n```\n\n**Root** (**[Parent][dfn-parent]**) represents a document.\n\n**Root** can be used as the *[root][term-root]* of a *[tree][term-tree]*,\nor as a value of the `content` field on a `'template'`\n**[Element][dfn-element]**,\nnever as a *[child][term-child]*.\n\n### `Text`\n\n```idl\ninterface Text \u003c: Literal {\n  type: 'text'\n}\n```\n\n**Text** (**[Literal][dfn-literal]**) represents a [Text][concept-text]\n([\\[DOM\\]][whatwg-dom]).\n\nFor example,\nthe following HTML:\n\n```html\n\u003cspan\u003eFoxtrot\u003c/span\u003e\n```\n\nYields:\n\n```js\n{\n  type: 'element',\n  tagName: 'span',\n  properties: {},\n  children: [{type: 'text', value: 'Foxtrot'}]\n}\n```\n\n## Other types\n\n### `Properties`\n\n```idl\ninterface Properties {}\n```\n\n**Properties** represents information associated with an element.\n\nEvery field must be a **[PropertyName][dfn-property-name]** and every value a\n**[PropertyValue][dfn-property-value]**.\n\n### `PropertyName`\n\n```idl\ntypedef string PropertyName\n```\n\nProperty names are keys on **[Properties][dfn-properties]** objects and reflect\nHTML,\nSVG,\nARIA,\nXML,\nXMLNS,\nor XLink attribute names.\nOften,\nthey have the same value as the corresponding attribute\n(for example,\n`id` is a property name reflecting the `id` attribute name),\nbut there are some notable differences.\n\n\u003e These rules aren’t simple.\n\u003e Use [`hastscript`][github-hastscript]\n\u003e (or [`property-information`][github-property-information] directly)\n\u003e to help.\n\nThe following rules are used to transform HTML attribute names to property\nnames.\nThese rules are based on\n[how ARIA is reflected in the DOM][concept-aria-reflection]\n([\\[ARIA\\]][w3c-aria]),\nand differs from how some\n(older)\nHTML attributes are reflected in the DOM.\n\n1. any name referencing a combinations of multiple words\n   (such as “stroke miter limit”) becomes a camelcased property name\n   capitalizing each word boundary;\n   this includes combinations that are sometimes written as several words;\n   for example,\n   `stroke-miterlimit` becomes `strokeMiterLimit`,\n   `autocorrect` becomes `autoCorrect`,\n   and `allowfullscreen` becomes `allowFullScreen`\n2. any name that can be hyphenated,\n   becomes a camelcased property name capitalizing each boundary;\n   for example,\n   “read-only” becomes `readOnly`\n3. compound words that are not used with spaces or hyphens are treated as a\n   normal word and the previous rules apply;\n   for example,\n   “placeholder”,\n   “strikethrough”,\n   and “playback” stay the same\n4. acronyms in names are treated as a normal word and the previous rules apply;\n   for example,\n   `itemid` become `itemId` and `bgcolor` becomes `bgColor`\n\n###### Exceptions\n\nSome jargon is seen as one word even though it may not be seen as such by\ndictionaries.\nFor example,\n`nohref` becomes `noHref`,\n`playsinline` becomes `playsInline`,\nand `accept-charset` becomes `acceptCharset`.\n\nThe HTML attributes `class` and `for` respectively become `className` and\n`htmlFor` in alignment with the DOM.\nNo other attributes gain different names as properties,\nother than a change in casing.\n\n###### Notes\n\n[`property-information`][github-property-information] lists all property names.\n\nThe property name rules differ from how HTML is reflected in the DOM for the\nfollowing attributes:\n\n\u003cdetails\u003e\n\u003csummary\u003eView list of differences\u003c/summary\u003e\n\n* `charoff` becomes `charOff` (not `chOff`)\n* `char` stays `char` (does not become `ch`)\n* `rel` stays `rel` (does not become `relList`)\n* `checked` stays `checked` (does not become `defaultChecked`)\n* `muted` stays `muted` (does not become `defaultMuted`)\n* `value` stays `value` (does not become `defaultValue`)\n* `selected` stays `selected` (does not become `defaultSelected`)\n* `allowfullscreen` becomes `allowFullScreen` (not `allowFullscreen`)\n* `hreflang` becomes `hrefLang`, not `hreflang`\n* `autoplay` becomes `autoPlay`, not `autoplay`\n* `autocomplete` becomes `autoComplete` (not `autocomplete`)\n* `autofocus` becomes `autoFocus`, not `autofocus`\n* `enctype` becomes `encType`, not `enctype`\n* `formenctype` becomes `formEncType` (not `formEnctype`)\n* `vspace` becomes `vSpace`, not `vspace`\n* `hspace` becomes `hSpace`, not `hspace`\n* `lowsrc` becomes `lowSrc`, not `lowsrc`\n\n\u003c/details\u003e\n\n### `PropertyValue`\n\n```idl\ntypedef any PropertyValue\n```\n\nProperty values should reflect the data type determined by their property name.\nFor example,\nthe HTML `\u003cdiv hidden\u003e\u003c/div\u003e` has a `hidden` attribute,\nwhich is reflected as a `hidden` property name set to the property value `true`,\nand `\u003cinput minlength=\"5\"\u003e`,\nwhich has a `minlength` attribute,\nis reflected as a `minLength` property name set to the property value `5`.\n\n\u003e In [JSON][ietf-json],\n\u003e the value `null` must be treated as if the property was not included.\n\u003e In [JavaScript][ecma-javascript],\n\u003e both `null` and `undefined` must be similarly ignored.\n\nThe DOM has strict rules on how it coerces HTML to expected values,\nwhereas hast is more lenient in how it reflects the source.\nWhere the DOM treats `\u003cdiv hidden=\"no\"\u003e\u003c/div\u003e` as having a value of `true` and\n`\u003cimg width=\"yes\"\u003e` as having a value of `0`,\nthese should be reflected as `'no'` and `'yes'`,\nrespectively,\nin hast.\n\n\u003e The reason for this is to allow plugins and utilities to inspect these\n\u003e non-standard values.\n\nThe DOM also specifies comma separated and space separated lists attribute\nvalues.\nIn hast, these should be treated as ordered lists.\nFor example,\n`\u003cdiv class=\"alpha bravo\"\u003e\u003c/div\u003e` is represented as `['alpha', 'bravo']`.\n\n\u003e There’s no special format for the property value of the `style` property name.\n\n## Glossary\n\nSee [§ *Glossary* in `syntax-tree/unist`][github-unist-glossary].\n\n## List of utilities\n\nSee [§ *List of utilities* in `syntax-tree/unist`][github-unist-utilities]\nfor more utilities.\n\n\u003c!--lint disable media-style--\u003e\n\n\u003c!--\nUtilities.\nThe first is special.\nThe rest is sorted alphabetically based on content after `hast-util-`\n--\u003e\n\n* [`hastscript`](https://github.com/syntax-tree/hastscript)\n  — create trees\n* [`hast-util-assert`](https://github.com/syntax-tree/hast-util-assert)\n  — assert nodes\n* [`hast-util-class-list`](https://github.com/shredsnews/hast-util-class-list)\n  — simulate the browser’s `classList` API for hast nodes\n* [`hast-util-classnames`](https://github.com/syntax-tree/hast-util-classnames)\n  — merge class names together\n* [`hast-util-embedded`](https://github.com/syntax-tree/hast-util-embedded)\n  — check if a node is an embedded element\n* [`hast-util-excerpt`](https://github.com/syntax-tree/hast-util-excerpt)\n  — truncate the tree to a comment\n* [`hast-util-find-and-replace`](https://github.com/syntax-tree/hast-util-find-and-replace)\n  — find and replace text in a tree\n* [`hast-util-format`](https://github.com/syntax-tree/hast-util-format)\n  — format whitespace\n* [`hast-util-from-dom`](https://github.com/syntax-tree/hast-util-from-dom)\n  — transform from DOM tree\n* [`hast-util-from-html`](https://github.com/syntax-tree/hast-util-from-html)\n  — parse from HTML\n* [`hast-util-from-parse5`](https://github.com/syntax-tree/hast-util-from-parse5)\n  — transform from Parse5’s AST\n* [`hast-util-from-selector`](https://github.com/syntax-tree/hast-util-from-selector)\n  — parse CSS selectors to nodes\n* [`hast-util-from-string`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-from-string)\n  — set the plain-text value of a node (`textContent`)\n* [`hast-util-from-text`](https://github.com/syntax-tree/hast-util-from-text)\n  — set the plain-text value of a node (`innerText`)\n* [`hast-util-from-webparser`](https://github.com/Prettyhtml/prettyhtml/tree/HEAD/packages/hast-util-from-webparser)\n  — transform Webparser’s AST to hast\n* [`hast-util-has-property`](https://github.com/syntax-tree/hast-util-has-property)\n  — check if an element has a certain property\n* [`hast-util-heading`](https://github.com/syntax-tree/hast-util-heading)\n  — check if a node is heading content\n* [`hast-util-heading-rank`](https://github.com/syntax-tree/hast-util-heading-rank)\n  — get the rank (also known as depth or level) of headings\n* [`hast-util-interactive`](https://github.com/syntax-tree/hast-util-interactive)\n  — check if a node is interactive\n* [`hast-util-is-body-ok-link`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-body-ok-link)\n  — check if a `link` element is “Body OK”\n* [`hast-util-is-conditional-comment`](https://github.com/rehypejs/rehype-minify/tree/HEAD/packages/hast-util-is-conditional-comment)\n  — check if `node` is a conditional comment\n* [`hast-util-is-css-link`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-css-link)\n  — check if `node` is a CSS `link`\n* [`hast-util-is-css-style`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-css-style)\n  — check if `node` is a CSS `style`\n* [`hast-util-is-element`](https://github.com/syntax-tree/hast-util-is-element)\n  — check if `node` is a (certain) element\n* [`hast-util-is-event-handler`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-event-handler)\n  — check if `property` is an event handler\n* [`hast-util-is-javascript`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-is-javascript)\n  — check if `node` is a JavaScript `script`\n* [`hast-util-labelable`](https://github.com/syntax-tree/hast-util-labelable)\n  — check if `node` is labelable\n* [`hast-util-minify-whitespace`](https://github.com/rehypejs/rehype-minify/tree/main/packages/hast-util-minify-whitespace)\n  — minify whitespace between elements\n* [`hast-util-parse-selector`](https://github.com/syntax-tree/hast-util-parse-selector)\n  — create an element from a simple CSS selector\n* [`hast-util-phrasing`](https://github.com/syntax-tree/hast-util-phrasing)\n  — check if a node is phrasing content\n* [`hast-util-raw`](https://github.com/syntax-tree/hast-util-raw)\n  — parse a tree again\n* [`hast-util-reading-time`](https://github.com/syntax-tree/hast-util-reading-time)\n  — estimate the reading time\n* [`hast-util-sanitize`](https://github.com/syntax-tree/hast-util-sanitize)\n  — sanitize nodes\n* [`hast-util-script-supporting`](https://github.com/syntax-tree/hast-util-script-supporting)\n  — check if `node` is script-supporting content\n* [`hast-util-select`](https://github.com/syntax-tree/hast-util-select)\n  — `querySelector`, `querySelectorAll`, and `matches`\n* [`hast-util-sectioning`](https://github.com/syntax-tree/hast-util-sectioning)\n  — check if `node` is sectioning content\n* [`hast-util-shift-heading`](https://github.com/syntax-tree/hast-util-shift-heading)\n  — change heading rank (depth, level)\n* [`hast-util-table-cell-style`](https://github.com/mapbox/hast-util-table-cell-style)\n  — transform deprecated styling attributes on table cells to inline styles\n* [`hast-util-to-dom`](https://github.com/syntax-tree/hast-util-to-dom)\n  — transform to a DOM tree\n* [`hast-util-to-estree`](https://github.com/syntax-tree/hast-util-to-estree)\n  — transform to estree (JavaScript AST) JSX\n* [`hast-util-to-html`](https://github.com/syntax-tree/hast-util-to-html)\n  — serialize as HTML\n* [`hast-util-to-jsx`](https://github.com/mapbox/jsxtreme-markdown/tree/HEAD/packages/hast-util-to-jsx)\n  — transform hast to JSX\n* [`hast-util-to-jsx-runtime`](https://github.com/syntax-tree/hast-util-to-jsx-runtime)\n  — transform to preact, react, solid, svelte, vue, etc\n* [`hast-util-to-mdast`](https://github.com/syntax-tree/hast-util-to-mdast)\n  — transform to mdast (markdown)\n* [`hast-util-to-nlcst`](https://github.com/syntax-tree/hast-util-to-nlcst)\n  — transform to nlcst (natural language)\n* [`hast-util-to-parse5`](https://github.com/syntax-tree/hast-util-to-parse5)\n  — transform to Parse5’s AST\n* [`hast-util-to-portable-text`](https://github.com/rexxars/hast-util-to-portable-text)\n  — transform to portable text\n* [`hast-util-to-string`](https://github.com/rehypejs/rehype-minify/tree/HEAD/packages/hast-util-to-string)\n  — get the plain-text value of a node (`textContent`)\n* [`hast-util-to-text`](https://github.com/syntax-tree/hast-util-to-text)\n  — get the plain-text value of a node (`innerText`)\n* [`hast-util-to-xast`](https://github.com/syntax-tree/hast-util-to-xast)\n  — transform to xast (xml)\n* [`hast-util-transparent`](https://github.com/syntax-tree/hast-util-transparent)\n  — check if `node` is transparent content\n* [`hast-util-truncate`](https://github.com/syntax-tree/hast-util-truncate)\n  — truncate the tree to a certain number of characters\n* [`hast-util-whitespace`](https://github.com/syntax-tree/hast-util-whitespace)\n  — check if `node` is inter-element whitespace\n\n## Related HTML utilities\n\n* [`a-rel`](https://github.com/wooorm/a-rel)\n  — List of link types for `rel` on `a` / `area`\n* [`aria-attributes`](https://github.com/wooorm/aria-attributes)\n  — List of ARIA attributes\n* [`collapse-white-space`](https://github.com/wooorm/collapse-white-space)\n  — Replace multiple white-space characters with a single space\n* [`comma-separated-tokens`](https://github.com/wooorm/comma-separated-tokens)\n  — Parse/stringify comma separated tokens\n* [`html-tag-names`](https://github.com/wooorm/html-tag-names)\n  — List of HTML tag names\n* [`html-dangerous-encodings`](https://github.com/wooorm/html-dangerous-encodings)\n  — List of dangerous HTML character encoding labels\n* [`html-encodings`](https://github.com/wooorm/html-encodings)\n  — List of HTML character encoding labels\n* [`html-element-attributes`](https://github.com/wooorm/html-element-attributes)\n  — Map of HTML attributes\n* [`html-event-attributes`](https://github.com/wooorm/html-event-attributes)\n  — List of HTML event handler content attributes\n* [`html-void-elements`](https://github.com/wooorm/html-void-elements)\n  — List of void HTML tag names\n* [`link-rel`](https://github.com/wooorm/link-rel)\n  — List of link types for `rel` on `link`\n* [`mathml-tag-names`](https://github.com/wooorm/mathml-tag-names)\n  — List of MathML tag names\n* [`meta-name`](https://github.com/wooorm/meta-name)\n  — List of values for `name` on `meta`\n* [`property-information`](https://github.com/wooorm/property-information)\n  — Information on HTML properties\n* [`space-separated-tokens`](https://github.com/wooorm/space-separated-tokens)\n  — Parse/stringify space separated tokens\n* [`svg-tag-names`](https://github.com/wooorm/svg-tag-names)\n  — List of SVG tag names\n* [`svg-element-attributes`](https://github.com/wooorm/svg-element-attributes)\n  — Map of SVG attributes\n* [`svg-event-attributes`](https://github.com/wooorm/svg-event-attributes)\n  — List of SVG event handler content attributes\n* [`web-namespaces`](https://github.com/wooorm/web-namespaces)\n  — Map of web namespaces\n\n\u003c!--lint enable media-style--\u003e\n\n## References\n\n* **unist**:\n  [Universal Syntax Tree][github-unist].\n  T. Wormer; et al.\n* **JavaScript**:\n  [ECMAScript Language Specification][ecma-javascript].\n  Ecma International.\n* **HTML**:\n  [HTML Standard][whatwg-html],\n  A. van Kesteren; et al.\n  WHATWG.\n* **DOM**:\n  [DOM Standard][whatwg-dom],\n  A. van Kesteren,\n  A. Gregor,\n  Ms2ger.\n  WHATWG.\n* **SVG**:\n  [Scalable Vector Graphics (SVG)][w3c-svg],\n  N. Andronikos,\n  R. Atanassov,\n  T. Bah,\n  B. Birtles,\n  B. Brinza,\n  C. Concolato,\n  E. Dahlström,\n  C. Lilley,\n  C. McCormack,\n  D. Schepers,\n  R. Schwerdtfeger,\n  D. Storey,\n  S. Takagi,\n  J. Watt.\n  W3C.\n* **MathML**:\n  [Mathematical Markup Language Standard][w3c-mathml],\n  D. Carlisle,\n  P. Ion,\n  R. Miner.\n  W3C.\n* **ARIA**:\n  [Accessible Rich Internet Applications (WAI-ARIA)][w3c-aria],\n  J. Diggs,\n  J. Craig,\n  S. McCarron,\n  M. Cooper.\n  W3C.\n* **JSON**\n  [The JavaScript Object Notation (JSON) Data Interchange Format][ietf-json],\n  T. Bray.\n  IETF.\n* **Web IDL**:\n  [Web IDL][whatwg-webidl],\n  C. McCormack.\n  W3C.\n\n## Security\n\nAs hast represents HTML,\nand improper use of HTML can open you up to a\n[cross-site scripting (XSS)][wikipedia-xss] attack,\nimproper use of hast is also unsafe.\nAlways be careful with user input and use\n[`hast-util-santize`][github-hast-util-sanitize] to make the hast tree safe.\n\n## Related\n\n* [mdast](https://github.com/syntax-tree/mdast)\n  — Markdown Abstract Syntax Tree format\n* [nlcst](https://github.com/syntax-tree/nlcst)\n  — Natural Language Concrete Syntax Tree format\n* [xast](https://github.com/syntax-tree/xast)\n  — Extensible Abstract Syntax Tree\n\n## Contribute\n\nSee [`contributing.md`][health-contributing] in\n[`syntax-tree/.github`][health] for ways to get started.\nSee [`support.md`][health-support] for ways to get help.\n\nA curated list of awesome syntax-tree,\nunist,\nmdast,\nhast,\nxast,\nand nlcst resources can be found in\n[awesome syntax-tree][github-syntax-tree-awesome].\n\nThis project has a [code of conduct][health-coc].\nBy interacting with this repository,\norganization,\nor community you agree to abide by its terms.\n\n## Acknowledgments\n\nThe initial release of this project was authored by\n[**@wooorm**](https://github.com/wooorm).\n\nSpecial thanks to [**@eush77**](https://github.com/eush77) for their work,\nideas,\nand incredibly valuable feedback!\n\nThanks to\n[**@andrewburgess**](https://github.com/andrewburgess),\n[**@arobase-che**](https://github.com/arobase-che),\n[**@arystan-sw**](https://github.com/arystan-sw),\n[**@BarryThePenguin**](https://github.com/BarryThePenguin),\n[**@brechtcs**](https://github.com/brechtcs),\n[**@ChristianMurphy**](https://github.com/ChristianMurphy),\n[**@ChristopherBiscardi**](https://github.com/ChristopherBiscardi),\n[**@craftzdog**](https://github.com/craftzdog),\n[**@cupojoe**](https://github.com/cupojoe),\n[**@davidtheclark**](https://github.com/davidtheclark),\n[**@derhuerst**](https://github.com/derhuerst),\n[**@detj**](https://github.com/detj),\n[**@DxCx**](https://github.com/DxCx),\n[**@erquhart**](https://github.com/erquhart),\n[**@flurmbo**](https://github.com/flurmbo),\n[**@Hamms**](https://github.com/Hamms),\n[**@Hypercubed**](https://github.com/Hypercubed),\n[**@inklesspen**](https://github.com/inklesspen),\n[**@jeffal**](https://github.com/jeffal),\n[**@jlevy**](https://github.com/jlevy),\n[**@Justineo**](https://github.com/Justineo),\n[**@lfittl**](https://github.com/lfittl),\n[**@kgryte**](https://github.com/kgryte),\n[**@kmck**](https://github.com/kmck),\n[**@kthjm**](https://github.com/kthjm),\n[**@KyleAMathews**](https://github.com/KyleAMathews),\n[**@macklinu**](https://github.com/macklinu),\n[**@medfreeman**](https://github.com/medfreeman),\n[**@Murderlon**](https://github.com/Murderlon),\n[**@nevik**](https://github.com/nevik),\n[**@nokome**](https://github.com/nokome),\n[**@phiresky**](https://github.com/phiresky),\n[**@revolunet**](https://github.com/revolunet),\n[**@rhysd**](https://github.com/rhysd),\n[**@Rokt33r**](https://github.com/Rokt33r),\n[**@rubys**](https://github.com/rubys),\n[**@s1n**](https://github.com/s1n),\n[**@Sarah-Seo**](https://github.com/Sarah-Seo),\n[**@sethvincent**](https://github.com/sethvincent),\n[**@simov**](https://github.com/simov),\n[**@StarpTech**](https://github.com/StarpTech),\n[**@stefanprobst**](https://github.com/stefanprobst),\n[**@stuff**](https://github.com/stuff),\n[**@subhero24**](https://github.com/subhero24),\n[**@tripodsan**](https://github.com/tripodsan),\n[**@tunnckoCore**](https://github.com/tunnckoCore),\n[**@vhf**](https://github.com/vhf),\n[**@voischev**](https://github.com/voischev), and\n[**@zjaml**](https://github.com/zjaml),\nfor contributing to hast and related projects!\n\n## License\n\n[CC-BY-4.0][creativecommons-by-4] © [Titus Wormer][wooorm]\n\n\u003c!-- Definitions --\u003e\n\n[concept-aria-reflection]: https://w3c.github.io/aria/#idl_attr_disambiguation\n\n[concept-comment]: https://dom.spec.whatwg.org/#interface-comment\n\n[concept-documenttype]: https://dom.spec.whatwg.org/#documenttype\n\n[concept-element]: https://dom.spec.whatwg.org/#interface-element\n\n[concept-local-name]: https://dom.spec.whatwg.org/#concept-element-local-name\n\n[concept-scripting]: https://html.spec.whatwg.org/multipage/webappapis.html#enabling-and-disabling-scripting\n\n[concept-text]: https://dom.spec.whatwg.org/#interface-text\n\n[creativecommons-by-4]: https://creativecommons.org/licenses/by/4.0/\n\n[dfn-element]: #element\n\n[dfn-literal]: #literal\n\n[dfn-parent]: #parent\n\n[dfn-properties]: #properties\n\n[dfn-property-name]: #propertyname\n\n[dfn-property-value]: #propertyvalue\n\n[dfn-root]: #root\n\n[dfn-unist-literal]: https://github.com/syntax-tree/unist#literal\n\n[dfn-unist-node]: https://github.com/syntax-tree/unist#node\n\n[dfn-unist-parent]: https://github.com/syntax-tree/unist#parent\n\n[ecma-javascript]: https://www.ecma-international.org/ecma-262/9.0/index.html\n\n[github-hast-logo]: https://raw.githubusercontent.com/syntax-tree/hast/6a36689/logo.svg?sanitize=true\n\n[github-hast-release]: https://github.com/syntax-tree/hast/releases/tag/2.4.0\n\n[github-hast-releases]: https://github.com/syntax-tree/hast/releases\n\n[github-hast-util-sanitize]: https://github.com/syntax-tree/hast-util-sanitize\n\n[github-hastscript]: https://github.com/syntax-tree/hastscript\n\n[github-property-information]: https://github.com/wooorm/property-information\n\n[github-rehype]: https://github.com/rehypejs/rehype\n\n[github-syntax-tree-awesome]: https://github.com/syntax-tree/awesome-syntax-tree\n\n[github-unified]: https://github.com/unifiedjs/unified\n\n[github-unist]: https://github.com/syntax-tree/unist\n\n[github-unist-glossary]: https://github.com/syntax-tree/unist#glossary\n\n[github-unist-syntax-tree]: https://github.com/syntax-tree/unist#syntax-tree\n\n[github-unist-utilities]: https://github.com/syntax-tree/unist#list-of-utilities\n\n[health]: https://github.com/syntax-tree/.github\n\n[health-coc]: https://github.com/syntax-tree/.github/blob/HEAD/code-of-conduct.md\n\n[health-contributing]: https://github.com/syntax-tree/.github/blob/HEAD/contributing.md\n\n[health-support]: https://github.com/syntax-tree/.github/blob/HEAD/support.md\n\n[ietf-json]: https://datatracker.ietf.org/doc/html/rfc7159\n\n[section-utilities]: #list-of-utilities\n\n[term-child]: https://github.com/syntax-tree/unist#child\n\n[term-leaf]: https://github.com/syntax-tree/unist#leaf\n\n[term-root]: https://github.com/syntax-tree/unist#root\n\n[term-tree]: https://github.com/syntax-tree/unist#tree\n\n[w3c-aria]: https://www.w3.org/TR/wai-aria-1.3/\n\n[w3c-mathml]: https://www.w3.org/TR/mathml4/\n\n[w3c-svg]: https://www.w3.org/TR/SVG2/\n\n[whatwg-dom]: https://dom.spec.whatwg.org/\n\n[whatwg-html]: https://html.spec.whatwg.org/multipage/\n\n[whatwg-webidl]: https://webidl.spec.whatwg.org\n\n[wikipedia-xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[wooorm]: https://wooorm.com\n","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified","https://thanks.dev/u/gh/syntax-tree"],"categories":["Others","Official","hast utilities"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntax-tree%2Fhast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyntax-tree%2Fhast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyntax-tree%2Fhast/lists"}