<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: Cleaning up HTML</title>
	<atom:link href="http://dougal.gunters.org/blog/2003/02/27/cleaning-up-html/feed" rel="self" type="application/rss+xml" />
	<link>http://dougal.gunters.org/blog/2003/02/27/cleaning-up-html</link>
	<description>Random musings of a Southern geek</description>
	<pubDate>Mon, 01 Dec 2008 23:27:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7-almost-rc-9965</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: dusoft</title>
		<link>http://dougal.gunters.org/blog/2003/02/27/cleaning-up-html/comment-page-1#comment-516</link>
		<dc:creator>dusoft</dc:creator>
		<pubDate>Fri, 16 Apr 2004 14:20:32 +0000</pubDate>
		<guid isPermaLink="false">//?p=#comment-516</guid>
		<description>Check out &lt;a href="http://www.absolutengine.com" title="Content management system Absolut Engine - produces valid XHTML, WYSIWYG editor, clean URLS&lt; SEO built-in"&gt;Content management system Absolut Engine&lt;/a&gt;
It produces valid XHTML Strict from WYSIWYG editor!</description>
		<content:encoded><![CDATA[<p>Check out <a href="http://www.absolutengine.com" title="Content management system Absolut Engine - produces valid XHTML, WYSIWYG editor, clean URLS< SEO built-in">Content management system Absolut Engine</a><br />
It produces valid <acronym title='eXtensible HyperText Markup Language'><span class='caps'>XHTML</span></acronym> Strict from <acronym title='What You See Is What You Get'><span class='caps'>WYSIWYG</span></acronym> editor!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dougal</title>
		<link>http://dougal.gunters.org/blog/2003/02/27/cleaning-up-html/comment-page-1#comment-104</link>
		<dc:creator>Dougal</dc:creator>
		<pubDate>Mon, 10 Mar 2003 14:19:04 +0000</pubDate>
		<guid isPermaLink="false">//?p=#comment-104</guid>
		<description>&lt;p&gt;I already use the strip_tags() function (with the optional array of allowed tags). But it doesn't do anything to help close unbalanced tags, or to strip out attempts to insert javascript urls (unless you disallow links altogether).
&lt;/p&gt;
&lt;p&gt;
I'm still mulling the problem over. Another solution might be to use something like &lt;a href="http://www.phpbb.com/guide/phpBB_Users_Guide.html#section4_2_5"&gt;BBCode&lt;/a&gt;, or a &lt;a href="http://www.intertwingly.net/blog/1251.html"&gt;Wiki-like syntax&lt;/a&gt;.
&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>I already use the strip_tags() function (with the optional array of allowed tags). But it doesn&#8217;t do anything to help close unbalanced tags, or to strip out attempts to insert javascript urls (unless you disallow links altogether).
</p>
<p>
I&#8217;m still mulling the problem over. Another solution might be to use something like <a href="http://www.phpbb.com/guide/phpBB_Users_Guide.html#section4_2_5">BBCode</a>, or a <a href="http://www.intertwingly.net/blog/1251.html">Wiki-like syntax</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean "XariusX" Maddison</title>
		<link>http://dougal.gunters.org/blog/2003/02/27/cleaning-up-html/comment-page-1#comment-103</link>
		<dc:creator>Sean "XariusX" Maddison</dc:creator>
		<pubDate>Mon, 10 Mar 2003 13:22:26 +0000</pubDate>
		<guid isPermaLink="false">//?p=#comment-103</guid>
		<description>Try this:

$foo = strip_tags($foo)

then

$foo = nl2br($foo)

This will remove ALL HTML tags and format all newlines to &lt;br /&gt;

If thats what you are after anyway.</description>
		<content:encoded><![CDATA[<p>Try this:</p>
<p>$foo = strip_tags($foo)</p>
<p>then</p>
<p>$foo = nl2br($foo)</p>
<p>This will remove ALL <acronym title='HyperText Markup Language'><span class='caps'>HTML</span></acronym> tags and format all newlines to </p>
<p>If thats what you are after anyway.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dougal</title>
		<link>http://dougal.gunters.org/blog/2003/02/27/cleaning-up-html/comment-page-1#comment-101</link>
		<dc:creator>Dougal</dc:creator>
		<pubDate>Fri, 28 Feb 2003 18:50:15 +0000</pubDate>
		<guid isPermaLink="false">//?p=#comment-101</guid>
		<description>&lt;p&gt;Yes, I had run across phpTidyHt earlier today. I'm definitely going to take a look at it, though I still hope to find a solution that doesn't require a sytem call to an external program.
&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yes, I had run across phpTidyHt earlier today. I&#8217;m definitely going to take a look at it, though I still hope to find a solution that doesn&#8217;t require a sytem call to an external program.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://dougal.gunters.org/blog/2003/02/27/cleaning-up-html/comment-page-1#comment-100</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Fri, 28 Feb 2003 18:37:04 +0000</pubDate>
		<guid isPermaLink="false">//?p=#comment-100</guid>
		<description>&lt;a href="http://www.gemini1consulting.com/tekhelp/phptidyht/phptidyht_demo.php"&gt;This&lt;/a&gt; looks like a working demo. I suspect they're just passing it through the command line, which is what I'd recommend as the easiest solution as well.</description>
		<content:encoded><![CDATA[<p><a href="http://www.gemini1consulting.com/tekhelp/phptidyht/phptidyht_demo.php">This</a> looks like a working demo. I suspect they&#8217;re just passing it through the command line, which is what I&#8217;d recommend as the easiest solution as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dougal</title>
		<link>http://dougal.gunters.org/blog/2003/02/27/cleaning-up-html/comment-page-1#comment-99</link>
		<dc:creator>Dougal</dc:creator>
		<pubDate>Fri, 28 Feb 2003 11:50:08 +0000</pubDate>
		<guid isPermaLink="false">//?p=#comment-99</guid>
		<description>&lt;p&gt;
I &lt;em&gt;thought&lt;/em&gt; I had heard something about a native way to call Tidy from PHP, and I did do a search at &lt;a href="http://php.net/"&gt;php.net&lt;/a&gt;, but that came up empty. I just didn't have time to cast my net wider yet.
&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>
I <em>thought</em> I had heard something about a native way to call Tidy from <acronym title='Php Hypertext Processor'><span class='caps'>PHP</span></acronym>, and I did do a search at <a href="http://php.net/">php.net</a>, but that came up empty. I just didn&#8217;t have time to cast my net wider yet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://dougal.gunters.org/blog/2003/02/27/cleaning-up-html/comment-page-1#comment-98</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Fri, 28 Feb 2003 09:14:40 +0000</pubDate>
		<guid isPermaLink="false">//?p=#comment-98</guid>
		<description>The 'standard' tool for cleaning HTML (which can output XHTML) is HTML Tidy from the W3C (by Dave Raggett originally, I think) - I'm pretty sure you'll find a PHP interface with a bit of googling. I use this both as a desktop app and (Java version) embedded in code, and its results really do seem magical at times.</description>
		<content:encoded><![CDATA[<p>The &#8217;standard&#8217; tool for cleaning <acronym title='HyperText Markup Language'><span class='caps'>HTML</span></acronym> (which can output <acronym title='eXtensible HyperText Markup Language'><span class='caps'>XHTML</span></acronym>) is <acronym title='HyperText Markup Language'><span class='caps'>HTML</span></acronym> Tidy from the <acronym title='World Wide Web Consortium'><span class='caps'>W3C</span></acronym> (by Dave Raggett originally, I think) - I&#8217;m pretty sure you&#8217;ll find a <acronym title='Php Hypertext Processor'><span class='caps'>PHP</span></acronym> interface with a bit of googling. I use this both as a desktop app and (Java version) embedded in code, and its results really do seem magical at times.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
