hast-util-is-body-ok-link
hast utility to check if a link element is “Body OK”
Last updated 3 years ago by wooorm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install hast-util-is-body-ok-link 
SYNC missed versions from official npm registry.

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)

  • Return true for link elements with an itemProp
  • Return true for link elements with a rel list where one or more entries are pingback, prefetch, or stylesheet.

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

Current Tags

  • 2.0.0                                ...           latest (3 years ago)

6 Versions

  • 2.0.0                                ...           3 years ago
  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (0)
None

Copyright 2013 - present © cnpmjs.org | Home |