hast-util-is-javascript
hast utility to check if an element is a JavaScript script
Last updated 4 months ago by wooorm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hast-util-is-javascript 
SYNC missed versions from official npm registry.

hast-util-is-javascript

Build Coverage Downloads Size Sponsors Backers Chat

Check if an element is a JavaScript script.

Install

npm:

npm install hast-util-is-javascript

Use

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

ok(h('script')) //=> true
ok(h('script', {type: 'text/ecmascript'})) //=> true
ok(h('script', {language: 'ecmascript'})) //=> true
ok(h('script', {type: 'text/fooscript'})) //=> false
ok(h('script', {language: 'fooscript'})) //=> false

API

isJavaScript(node)

Return true if node is a <script> element that has a valid JavaScript type, has no type and a valid JavaScript language, or has neither.

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

  • 1.0.4                                ...           latest (4 months ago)

5 Versions

  • 1.0.4                                ...           4 months ago
  • 1.0.3                                ...           7 months ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           4 years ago

Copyright 2014 - 2017 © taobao.org |