Skip to content

BirdyOz/Sublime-cleanHTML

Repository files navigation

Sublime-cleanHTML

CleanHTML for Sublime Text

This ST3 plugin performs a range of HTML cleaning and code sanitisation functions. It is particularly good at cleaning up messy code that is generated by the Moodle ATTO editor.

Tag Removal

  • Unnecessary tags (span, section, article etc.)
  • Specific Empty tags (p, strong, em, li, h[1-6], b, ol, ul, etc.)
  • Poorly nested tags (li>p, ul>ul, ol>ol, p>p, p>ul, p>div etc.)

Attribute removal

  • font-sizes (style="font-size...")
  • YUI id's created by the ATTO editor (id="yui...")

External links

  • Ensure all external href's open in new tab

Deep cleaning (optional)

  • All style attributes (style="...")
  • Remove empty attributes (that are not alt="")

Table cleaning (optional)

  • All table tags (table, tbody, tr, th, thead, td, caption)

Dependancies

This plugin invokes functions from other Sublime Text Packages:

Please ensure that you have these plugins installed, prior to running CleanHTML

Usage

  1. Launch Package Control
  2. Type 'Clean HTML'
  3. Choose cleaning mode (Normal/Deep/Table)

Keyboard shortcuts (Mac) - Sorry Windows users, feel free to set your own.

  • CMD + Shift + \ - Normal
  • CMD + Opt + \ - Deep
  • CMD + Shift + Opt + \ - Table

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published