9 * @author Christian Weiske <cweiske@cweiske.de>
10 * @copyright 2014 Christian Weiske
11 * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
12 * @link http://cweiske.de/grauphel.htm
14 namespace OCA\Grauphel\Converter;
18 * Convert Tomboy note XML to HTML that can be used (nearly) standalone.
19 * This means it tries to use as many native tags as possible and
20 * does not rely on classes so much.
24 * @author Christian Weiske <cweiske@cweiske.de>
25 * @copyright 2014 Christian Weiske
26 * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
27 * @version Release: @package_version@
28 * @link http://cweiske.de/grauphel.htm
30 class CleanHtml extends Html
32 protected static $tagMap = array(
42 'strikethrough' => 'del',
46 protected static $styleClassMap = array(
47 'size:small' => 'small',
51 * Converts the tomboy note XML into HTML.
52 * Cleans HTML a bit up after it has been generated with the clean tags.
54 * @param string $xmlContent Tomboy note content
58 public function convert($xmlContent)
60 $html = parent::convert($xmlContent);
61 $html = str_replace('</h2><br />', '</h2>', $html);
62 $html = str_replace('</h3><br />', '</h3>', $html);
63 $html = str_replace("<br />\n</h2>", "</h2>\n", $html);
64 $html = str_replace("<br />\n</h3>", "</h3>\n", $html);
65 $html = str_replace("<br />\n</li>", "</li>\n", $html);
66 $html = str_replace("<br />\n<ul>", "<ul>\n", $html);