Skip to content

achmadk/void-elements

 
 

Repository files navigation

void-elements

📝 Object of "void elements" defined by the HTML Standard

Exports an Object of "void element" node names as defined by the HTML spec.

The list is programatically generated from the latest WHATWG HTML Standard.

npm version

🔧 Usage

1. node.js

const voidElements = require('@achmadk/void-elements');

assert(!voidElements['span'], '<span> is not a void element');
assert(voidElements['img'], '<img> is a void element');

2. vite js (if have error importing void-elements)

import { defineConfig } from 'vite'

export default defineConfig({
  // rest of your vite configuration
  resolve: {
    alias: [
      // another aliases
      {
        find: 'void-elements',
        replacement: '@achmadk/void-elements'
      }
    ]
  }
})

License

MIT

About

Object of "void elements" as defined by the WHATWG HTML Standard.

Resources

License

Stars

Watchers

Forks

Languages

  • JavaScript 100.0%