Socket
Socket
Sign inDemoInstall

posthtml-doctype

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    posthtml-doctype

posthtml doctype plugin


Version published
Weekly downloads
335
decreased by-2.33%
Maintainers
1
Install size
5.62 kB
Created
Weekly downloads
 

Readme

Source

PostHTML-doctype

npm version

PostHTML plugin to simplify working with doctype.

Usage

var posthtml = require('posthtml'),
    html = '<html><head><title>Wow</title></head><body><div class="button"><div class="button__text">Text</div></div></body></html>';

posthtml()
    .use(require('posthtml-doctype')({ doctype: 'HTML 5' }))
    .process(html)
    .then(function(result) {
        console.log(result.html);
        //<!DOCTYPE html><html><head><title>Wow</title></head><body><div class="button"><div class="button__text">Text</div></div></body></html>
    })

Options

{ doctype : 'HTML 5' }
<!DOCTYPE html>
{ doctype : 'HTML 4.01 Strict' }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
{ doctype : 'HTML 4.01 Transitional' }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
{ doctype : 'HTML 4.01 Frameset' }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
{ doctype : 'XHTML 1.0 Strict' }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
{ doctype : 'XHTML 1.0 Transitional' }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{ doctype : 'XHTML 1.0 Frameset' }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
{ doctype : 'XHTML 1.1' }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Keywords

FAQs

Last updated on 06 Oct 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc