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
  • 2 hours ago
  • 11 years ago

Installs

  • Total 306
  • Win 214
  • Mac 73
  • Linux 19
Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12
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