ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

HTML Crush Switch

by me ST2

HTML code crush: turn it on for uploading, turn it off for working. Keep the web small and the code easy on the eyes.

Details

  • 2013.03.10.17.58.24
  • bitbucket.​org
  • 11 years ago
  • 1 hour ago
  • 11 years ago

Installs

  • Total 306
  • Win 214
  • Mac 73
  • Linux 19
Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
bitbucket.​org

HTML Crush Switch

Summary

HTML code crush: turn it on for uploading, turn it off for working. Keep the web small and the code easy on the eyes.

Warning

Take care with PHP and Javascript embedded codes! The crush process COULD mess them up. It is always a good practice to separate the PHP and Javascript code in separate documents, so you can use a specific crusher for each type. In any case, you should ALWAYS test the webpage after crushing it.

How do I switch?

You can switch the crush ON and OFF with the command palette (by default, cmd+shift+p in OS X and ctrl+shift+p in Windows and Linux). The commands are called with “HTML Crush Switch ON” and “HTML Crush Switch OFF”.

What the switch does?

Crush ON:

  • HTML Comments removed ()
  • JS/PHP Multiline comments removed (/* comment */)
  • Indentations and trailing spaces removed.
  • New line characters removed if they are after…
    • a HTML tag closer (>)
    • a semicolon, for JS and PHP (;)
    • an open or close brace ({})
    • a simple or double quote ('“)

Crush OFF:

  • Separates the code into lines:
    • Separates HTML tags.
    • New line after semicolon or braces.
    • Tries to keep HTML singletons in their own line.
    • Tries to keep small tags in one line.
  • Reindent the code, using a specific algorithm (default) or using the ST 'reindent' function.

Changelog

v1.0 - 2012/03/10

Initial version