Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

You probably want to use original lib -https://github.com/kangax/html-minifier

NotificationsYou must be signed in to change notification settings

Yuriy-Svetlov/html-minifier-without-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

You probably want to use original lib -https://github.com/kangax/html-minifier

Get started

Install

npm i html-minifier-without-js

Example 1

import{minify}from'html-minifier-without-js/src/htmlminifier.js'lethtmlSource='<div>                  <h1>TEST H1</h1>                            <h2>TEST H2</h2></div>                <p title="blah">    foo       </p>';varresult=minify(htmlSource,{collapseWhitespace:true,//удаляем пустые пространства между тегамиremoveComments:true,//удаляем коментарииremoveScriptTypeAttributes:true,//Remove type="text/javascript" from script tags. Other type attribute values are left intactincludeAutoGeneratedTags:false,ignoreCustomComments:[// ignore noindex comments/^noindex/,/\/noindex+$/],minifyCSS:true,//минифицирует JStrimCustomFragments:true,//Удаляет пустой пространство около игнорируемых элементов//ignoreCustomFragments: [ (/\{\%[^\%]*?\%\}(\s)?/g) ], //Игнорирования тега});console.log(result);

About

You probably want to use original lib -https://github.com/kangax/html-minifier

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp