public static function cleanHTML($content, $cleaner = null)
    {
        if (!$cleaner) {
            if (self::$html_cleaner_class && class_exists(self::$html_cleaner_class)) {
                $cleaner = Injector::inst()->create(self::$html_cleaner_class);
            } else {
                //load cleaner if the dependent class is available
                $cleaner = HTMLCleaner::inst();
            }
        }

        if ($cleaner) {
            $content = $cleaner->cleanHTML($content);
        } else {
            // At most basic level of cleaning, use DOMDocument to save valid XML.
            $doc = HTMLValue::create($content);
            $content = $doc->getContent();
        }

        // Remove empty <ins /> and <del /> tags because browsers hate them
        $content = preg_replace('/<(ins|del)[^>]*\/>/', '', $content);

        return $content;
    }