<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Adding &amp;lt;b&amp;gt; and &amp;lt;i&amp;gt; to Tidy</title>
        <description>I wanted users in a forum of mine to be able to use &amp;lt;b&amp;gt; and &amp;lt;i&amp;gt;, yet they should be converted to &amp;lt;strong&amp;gt; and &amp;lt;em&amp;gt; and I therefore did not want to allow &amp;lt;b&amp;gt; and &amp;lt;i&amp;gt;, they should only be converted.

I added the lines


$r['b'] = new HTMLPurifier_TagTransform_Simple('strong');
$r['i'] = new HTMLPurifier_TagTransform_Simple('em');


into XHTMLAndHTML4.php in the Tidy HTMLModule, and in my script through


$config-&amp;gt;set('HTML', 'TidyAdd', 'b');
$config-&amp;gt;set('HTML', 'TidyAdd', 'i');


these additional Tidy rules are enforced - which works fine.

I wanted to suggest to maybe add these rules as optional (only gets used if specifically chosen through TidyAdd) to Tidy, also a few other HTML tags like &amp;lt;big&amp;gt; or &amp;lt;small&amp;gt; could be added to help replace tags which should better not be used nowadays, although &amp;lt;b&amp;gt; and &amp;lt;i&amp;gt; are by far the most commonly still used (especially by users). These tags are not deprecated, that's why it should only be optional, or it could also be an own module independent of Tidy.

If something like this already exists than I apologize for bringing it up (and would be glad to hear where to find it) - I just thought it would be great to have this feature included without having to edit the library itself :-) And I did not know of any other way to easily convert one tag to another with HTMLPurifier (which is probably also not a common use case).</description>
        <link>http://htmlpurifier.org/phorum/read.php?5,2663,2663#msg-2663</link>
        <lastBuildDate>Fri, 24 May 2013 09:16:13 -0400</lastBuildDate>
        <generator>Phorum 5.2.18</generator>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?5,2663,4621#msg-4621</guid>
            <title>Re: Adding &lt;b&gt; and &lt;i&gt; to Tidy</title>
            <link>http://htmlpurifier.org/phorum/read.php?5,2663,4621#msg-4621</link>
            <description><![CDATA[<p>It certainly wouldn't be built in by default.</p>]]></description>
            <dc:creator>Ambush Commander</dc:creator>
            <category>Internals</category>
            <pubDate>Wed, 26 May 2010 14:07:05 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?5,2663,4620#msg-4620</guid>
            <title>Re: Adding &lt;b&gt; and &lt;i&gt; to Tidy</title>
            <link>http://htmlpurifier.org/phorum/read.php?5,2663,4620#msg-4620</link>
            <description><![CDATA[<p>I disagree that <code>&lt;i&gt;</code> should not be used. It does not have at all the same meaning as <code>&lt;em&gt;</code>. There are plenty of grammatical reasons for wanting italics which have nothing to do with emphasis.</p>

<p>TRiG.</p>]]></description>
            <dc:creator>TRiG</dc:creator>
            <category>Internals</category>
            <pubDate>Wed, 26 May 2010 13:39:16 -0400</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?5,2663,2664#msg-2664</guid>
            <title>Re: Adding &lt;b&gt; and &lt;i&gt; to Tidy</title>
            <link>http://htmlpurifier.org/phorum/read.php?5,2663,2664#msg-2664</link>
            <description><![CDATA[<p>It is possible to add tag transform rules without editing code:</p>

<pre>
$config-&gt;set('HTML', 'DefinitionID', 'extra-transforms');
$config-&gt;set('HTML', 'DefinitionRev', 1);
$def = $config-&gt;getHTMLDefinition(true);
$def-&gt;info_tag_transform['b'] = new HTMLPurifier_TagTransform_Simple('strong');
$def-&gt;info_tag_transform['i'] = new HTMLPurifier_TagTransform_Simple('em');
</pre>

<p>As for something built-in, it might be a good idea. Would you be interested? ;-)</p>]]></description>
            <dc:creator>Ambush Commander</dc:creator>
            <category>Internals</category>
            <pubDate>Tue, 18 Nov 2008 20:28:18 -0500</pubDate>
        </item>
        <item>
            <guid>http://htmlpurifier.org/phorum/read.php?5,2663,2663#msg-2663</guid>
            <title>Adding &lt;b&gt; and &lt;i&gt; to Tidy</title>
            <link>http://htmlpurifier.org/phorum/read.php?5,2663,2663#msg-2663</link>
            <description><![CDATA[<p>I wanted users in a forum of mine to be able to use &lt;b&gt; and &lt;i&gt;, yet they should be converted to &lt;strong&gt; and &lt;em&gt; and I therefore did not want to allow &lt;b&gt; and &lt;i&gt;, they should only be converted.</p>

<p>I added the lines</p>

<pre>
$r['b'] = new HTMLPurifier_TagTransform_Simple('strong');
$r['i'] = new HTMLPurifier_TagTransform_Simple('em');
</pre>

<p>into XHTMLAndHTML4.php in the Tidy HTMLModule, and in my script through</p>

<pre>
$config-&gt;set('HTML', 'TidyAdd', 'b');
$config-&gt;set('HTML', 'TidyAdd', 'i');
</pre>

<p>these additional Tidy rules are enforced - which works fine.</p>

<p>I wanted to suggest to maybe add these rules as optional (only gets used if specifically chosen through TidyAdd) to Tidy, also a few other HTML tags like &lt;big&gt; or &lt;small&gt; could be added to help replace tags which should better not be used nowadays, although &lt;b&gt; and &lt;i&gt; are by far the most commonly still used (especially by users). These tags are not deprecated, that's why it should only be optional, or it could also be an own module independent of Tidy.</p>

<p>If something like this already exists than I apologize for bringing it up (and would be glad to hear where to find it) - I just thought it would be great to have this feature included without having to edit the library itself :-) And I did not know of any other way to easily convert one tag to another with HTMLPurifier (which is probably also not a common use case).</p>]]></description>
            <dc:creator>Iquito</dc:creator>
            <category>Internals</category>
            <pubDate>Tue, 18 Nov 2008 18:07:03 -0500</pubDate>
        </item>
    </channel>
</rss>
