Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including hast-util-is-body-ok-link with all npm packages installed. Try it out:

var hastUtilIsBodyOkLink = require("hast-util-is-body-ok-link")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

hast-util-is-body-ok-link v1.0.4

hast utility to check if a link element is “Body OK”

hast-util-is-body-ok-link

Build Coverage Downloads Size Sponsors Backers Chat

Check if a link element is “Body OK”.

Install

npm:

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

Use

var h = require('hastscript')
var ok = require('hast-util-is-body-ok-link')

ok(h('link', {itemProp: 'foo'})) //=> true
ok(h('link', {rel: ['stylesheet'], href: 'index.css'})) //=> true
ok(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

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free