GithubHelp home page GithubHelp logo

htmlminify-smarty's Introduction

HTMLMinify-Smarty

A simple Smarty filter for minifying HTML.

Installation

Copy HTMLMinify.smarty.php into your installation and included it.

Then you can register the filter with smarty:

$smarty->registerFilter("output", "minify_html");

URLs

The URL component is also minified. You can change the protocol and URL to assist with minifying if your $_SERVER attributes don't match up to the real URL.

define("HTML_MINIFY_URL", "https://ma.rkhugh.es");

Or if you don't want this feature you can disable it like this:

define("HTML_MINIFY_URL_ENABLED", false);

Inline CSS

By default we minifying inline CSS. You can disable it like this:

define("HTML_MINIFY_INLINE_CSS_ENABLED", false);

htmlminify-smarty's People

Contributors

markhughes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

htmlminify-smarty's Issues

Confirmed for Foreign Languages?

Has this been confirmed to work with foreign languages?
(PHP 7.2.10)
Given:

<a href="http://edserver.ddns.net/cubecart/ea-737b-elektro-masažer.html" title="Elektro masažer EA-737B">Elektro masažer EA-737B</a>

Result:

<a href="http://edserver.ddns.net/cubecart/ea-737b-elektro-masažer.html" title="Elektro masažer EA-737B">Elektro masa� er EA-737B</a>

exclude SSI includes

Hey Mark, I'm trying to use this plugin on my app but the problem is I couldn't find exclude SSI includes. You can see the example below. How can I add this exclude for checks? I want to use them but Your minify plugin is cleaning all of them as well :)

For info: http://www.htmlgoodies.com/beyond/webmaster/article.php/3473341/SSI-The-Include-Command.htm

Example:

<div>
<h1>Hello World</h1>
<!--# include virtual="/who_i_am.html" -->
<!--# include virtual="/ajax_call_for_list.html" -->
</div>

Also I tried to add regex for this |<!\-{2}\#[\s\S]*?\-{2}> to MINIFY_HTML_KEEP. It doesn't work. And then I tried to continue on inside of the fn_minify_html. But also it doesn't work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.