Sitecore Sweep

  0 rating
11/14/2016 1:08:02 PM
12/2/2016 10:53:43 AM
Source: GitHub
Provider: Kasaku Ltd.


This open-source module allows you to control the HTML saved in Rich-Text fields in Sitecore. It can control as little or as much as you like, as you can define the pipeline it follows to clean HTML.

Included in the module are a collection of pre-written methods of cleaning HTML, including:

  • Removing inline styling
  • Removing invalid classes (supports both whitelisting + blacklisting class names)
  • Removing empty elements (e.g. <p></p>)
  • Fixing shoddy headers (e.g. <p><strong>My title!</strong></p> --> <h2>My title!</h2>)
  • Ensuring text is wrapped in paragraph tags if no root element is found
  • Fixing nested paragraphs (e.g. <p><p>My text</p></p> --> <p>My text</p>)
  • Removing non-breaking spaces, because they shouldn't be used for spacing text.
  • Removing inner-elements from headers

 It's very easy to add your own steps, just be extending a base processor class.

On top of this, the module installs a "Clean HTML" button to the full Rich Text Editor profile. This allows content-editors to clean their HTML on demand. In fact you can entirely disable the automatic cleaning pipeline and just allow your editors to use this method instead. 

The Rich Text Editor button is only currently supported by Sitecore 8, if there are demands for it then I should be able to implement this for earlier versions too. However the general pipeline has strong Sitecore support across older versions too.

See the GitHub page for full notes, and if you encounter any problems, please raise an issue there.


Release notes
Please insert section here whenever you add a new version of your Sitecore module package describing version number, new features, fixes and possible known issues.
Read more Back
Code examples

Solution screenshots(0)


Reviews (0)

Sort by: Date Most votes
  • Profile Avatar

    Level: 0

    x0 x0 x0




    Was this helpful?


Comments (0)

Sort by: Date  Most votes

Leave a Comment

Comment must be field in
Post comment

Write a review

Title can't be empty
Review can't be empty
Post review


Title Description Download Action

Add File