unified

Project: rehypejs/rehype-minify

Package: hast-util-is-body-ok-link@2.0.0

  1. Dependents: 3
  2. hast utility to check if a link element is “Body OK”
  1. util 143
  2. utility 139
  3. unist 127
  4. html 122
  5. hast 72
  6. hast-util 46
  7. link 14

hast-util-is-body-ok-link

Build Coverage Downloads Size Sponsors Backers Chat

Check if a link element is “Body OK”.

Install

This package is ESM only: Node 12+ is needed to use it and it must be importeded instead of requiredd.

npm:

npm install hast-util-is-body-ok-link

This package exports the following identifiers: isBodyOkLink. There is no default export.

Use

import {h} from 'hastscript'
import {isBodyOkLink} from 'hast-util-is-body-ok-link'

isBodyOkLink(h('link', {itemProp: 'foo'})) //=> true
isBodyOkLink(h('link', {rel: ['stylesheet'], href: 'index.css'})) //=> true
isBodyOkLink(h('link', {rel: ['author'], href: 'index.css'})) //=> false

API

isBodyOkLink(node)

Contribute

See contributing.md in rehypejs/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer