ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EE 2.x plugin to clean dirty/truncated html code

November 26, 2010 7:22pm

Subscribe [1]
  • #1 / Nov 26, 2010 7:22pm

    Musa

    124 posts

    Hi,
    I’ve developed a plugin ( Clean HTML ) for myself to clean dirty html code or truncated html code that compitable with EE 2.x. Want to share with you guys if that can help.

    This come with three parser. HTML Purifier, Tidy and custom
    HTML Purifier - http://htmlpurifier.org/
    HTML Tidy - http://www.w3.org/People/Raggett/tidy/, you server must have this support
    custom - native dirty html cleaning method

    From all of this, HTML Purifier is little slower than other but it works great, also need the library files with the plugin. HTML Tidy is little faster than HTML Purifier but your server must have the php tidy package. Custom is faster than all other but i need to improve this more.

    Parameters:
    engine   - tidy/purifier/custom. Which library want to use. Default value is purifier.
    excerpt_size - Optional. To truncate suppplied string to specific number of words.
                               
    To use this plugin, wrap anything you want to be processed by it between these tag pairs:

    {exp:clean_html excerpt="90" engine="tidy"}
    text and html code you want to clean
    {/exp:clean_html}

    Sourcecode at github.

    git://github.com/appskitchen/ak.clean_html.ee2_addon.git

    Devot:ee link - Clean HTML Plugin

    Your feedback is appreciated.
    Thanks
    Musa

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases