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)
This plugin invokes functions from other Sublime Text Packages:
Please ensure that you have these plugins installed, prior to running CleanHTML
- Launch Package Control
- Type 'Clean HTML'
- Choose cleaning mode (Normal/Deep/Table)
- CMD + Shift + \ - Normal
- CMD + Opt + \ - Deep
- CMD + Shift + Opt + \ - Table