optional-tags

0.0.4 • Public • Published

optional-tags

NPM Version NPM Downloads Build Status Test Coverage

Exports optional html tags with some levels, Constrainted by w3.org#optional-tags.

For some reason, we can omit element's start tag or end tag like this (comply with a standard):

<!doctype html><html lang="en"><link><base><body><ul><li>say hi<p>it's all we need</ul>

Why omit the tags? (unfinished drafts):

Example

var optionalTags = require('optional-tags')
 
// recommend
var safeTags = optionalTags(true) // or 'safe', or undefined
console.log( 'safe start tags: ', safeTags.starts.join('') )
console.log( 'safe end tags: ', safeTags.join('') )
 
// recommend, but make sure you don't use any comments or space character
var radicalTags = optionalTags('radical')
console.log( 'radical start tags: ', radicalTags.starts.join('') )
console.log( 'radical end tags: ', radicalTags.ends.join('') )

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i optional-tags

Weekly Downloads

5

Version

0.0.4

License

MIT

Last publish

Collaborators

  • cutsin