🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

posthtml-remove-tags

A posthtml A posthtml plugin for removing tags

Travis Build StatusAppVeyor Build Statusnodenpm versionDependency StatusXO code styleCoveralls status

npm downloadsnpmPackage Quality

Why?

Essential for removing unwanted or tags do not pass validation

Install

npm i -S posthtml posthtml-remove-tags

Note: This project is compatible with node v4+

Usage

import {readFileSync, writeFileSync} from 'fs';
import posthtml from 'posthtml';
import removeTags from 'posthtml-remove-tags';

const html = readFileSync('input.html', 'utf8');

posthtml()
    .use(removeTags({tags: ['style', 'script']}))
    .process(html)
    .then(result => {
        writeFileSync('output.html', result.html);
    });

Returns the html without the tags listed in option

Example

input.html

<!DOCTYPE html>
<head><style></style></head>

output.html

<!DOCTYPE html>
<head></head>

Options

tags

Type: Array
Default: []
Description: The list of tags to be deleted

LICENSE

MIT

About

A posthtml plugin for removing tags

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages