syntax-tree/hast-util-embedded


utility to check if a node is an embedded element

https://unified.js.org

License: MIT

Language: JavaScript

Keywords: embedded, hast, hast-util, html, unist, unist-util, util


hast-util-embedded

Build Coverage Downloads Size Sponsors Backers Chat

hast utility to check if an element is embedded.

Install

npm:

npm install hast-util-embedded

Usage

var embedded = require('hast-util-embedded')

// Given a non-embedded value:
embedded({
  type: 'element',
  tagName: 'a',
  properties: {href: '#alpha', title: 'Bravo'},
  children: [{type: 'text', value: 'Charlie'}]
}) // => false

// Given a embedded element:
embedded({
  type: 'element',
  tagName: 'audio',
  properties: {src: 'delta.ogg'},
  children: []
}) // => true

API

embedded(node)

Check if node is an embedded element.

Security

hast-util-embedded does not change the syntax tree so there are no openings for cross-site scripting (XSS) attacks.

Contribute

See contributing.md in syntax-tree/.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, organisation, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Project Statistics

Sourcerank 9
Repository Size 30.3 KB
Stars 1
Forks 0
Watchers 6
Open issues 0
Dependencies 9
Contributors 2
Tags 5
Created
Last updated
Last pushed

Top Contributors See all

Titus Greenkeeper

Packages Referencing this Repo

hast-util-embedded
Check if a node is a embedded element
Latest release 1.0.4 - Updated - 1 stars

Recent Tags See all

1.0.4 May 25, 2019
1.0.3 May 25, 2019
1.0.2 November 07, 2018
1.0.1 June 17, 2018
1.0.0 April 17, 2016

Something wrong with this page? Make a suggestion

Last synced: 2019-08-04 10:30:45 UTC

Login to resync this repository