<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ralph Holzmann &#187; HTML</title>
	<atom:link href="http://ralphholzmann.com/tag/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://ralphholzmann.com</link>
	<description>Web Development - jQuery, PHP, MySQL. In that order.</description>
	<lastBuildDate>Fri, 29 Jan 2010 14:01:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>JS Bin Links Now in All Code Snippets</title>
		<link>http://ralphholzmann.com/2009/12/14/js-bin-links-now-in-all-code-snippets/</link>
		<comments>http://ralphholzmann.com/2009/12/14/js-bin-links-now-in-all-code-snippets/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 16:37:43 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Edit]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JS Bin]]></category>
		<category><![CDATA[Preview]]></category>
		<category><![CDATA[Snippet]]></category>
		<category><![CDATA[Syntax Highlighter]]></category>

		<guid isPermaLink="false">http://ralphholzmann.com/?p=29</guid>
		<description><![CDATA[I&#8217;ve edited the core of the Syntax Highlighter plugin used on this site to highlight code snippets to include JS Bin links on its toolbar (where applicable). If the code snippet can be represented and played with in JS Bin, &#8230; <a href="http://ralphholzmann.com/2009/12/14/js-bin-links-now-in-all-code-snippets/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve edited the core of the <a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter">Syntax Highlighter</a> plugin used on this site to highlight code snippets to include <a href="http://jsbin.com/">JS Bin</a> links on its toolbar (where applicable). If the code snippet can be represented and played with in JS Bin, a link will appear in the toolbar to that code on jsbin.com. If you&#8217;re not familiar with JS Bin, it&#8217;s definitely worth checking out. It&#8217;s a very simple online collaborate HTML/JavaScript editing tool. You can create an HTML page with JavaScript, and then save it to a short URL that you can distribute to your friends, colleagues, blog readers etc. It&#8217;s very similar to <a href="http://code.google.com/apis/ajax/playground/">Google&#8217;s AJAX APIs Playground</a>, except you can save and distribute any JavaScript/HTML.</p>
]]></content:encoded>
			<wfw:commentRss>http://ralphholzmann.com/2009/12/14/js-bin-links-now-in-all-code-snippets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strip Specific HTML Tags From String</title>
		<link>http://ralphholzmann.com/2009/12/10/strip-specific-html-tags-from-string/</link>
		<comments>http://ralphholzmann.com/2009/12/10/strip-specific-html-tags-from-string/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 18:17:35 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Filter]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Regex]]></category>
		<category><![CDATA[Strip]]></category>
		<category><![CDATA[Tags]]></category>

		<guid isPermaLink="false">http://ralphholzmann.com/?p=20</guid>
		<description><![CDATA[In fiddling around with some code highlighters to use for this blog, I found myself needing a way to strip tags from a JavaScript string of HTML, while leaving others. I needed it so I could convert highlighted code to &#8230; <a href="http://ralphholzmann.com/2009/12/10/strip-specific-html-tags-from-string/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In fiddling around with some code highlighters to use for this blog, I found myself needing a way to strip tags from a JavaScript string of HTML, while leaving others. I needed it so I could convert highlighted code to plain text so user&#8217;s could copy and paste code snippets without all the HTML garbage. This is what I came up with:</p>
<pre class="brush:js" jsbin="http://jsbin.com/inewo">var saveTags = new RegExp('&lt;(?!((\/)?(li|span)))(.)?([a-zA-Z?])[^&gt;&lt;]*&gt;', 'gi');

var html = '&lt;div&gt;&lt;ol&gt;&lt;li&gt;&lt;span&gt;Some Text&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;';
var strippedHtml = html.replace(saveTags, '');

alert(html);          // &lt;div&gt;&lt;ol&gt;&lt;li&gt;&lt;span&gt;Some Text&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;
alert(strippedHtml);  // &lt;li&gt;&lt;span&gt;Some Text&lt;/span&gt;&lt;/li&gt;</pre>
<p>The <a href="http://www.w3schools.com/jsref/jsref_obj_regexp.asp">regex</a> matches all html tags<strong> except</strong> li and span. You then simply use the String method &#8216;<a href="http://www.w3schools.com/jsref/jsref_replace.asp">replace</a>&#8216; to replace the matches with an empty string. To edit the tags for the regex, simply change the tags in the expression, making sure to separate them with the bar &#8216;|&#8217; character.</p>
<p>After figuring out how to strip the specific tags , I didn&#8217;t even end up using it because I moved from <a href="http://code.google.com/p/jquery-chili-js/">jQuery Chili 2.2</a> to <a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter">SyntaxHighlighter</a> which has a built in source code viewer, but I thought the information was valuable nonetheless.</p>
]]></content:encoded>
			<wfw:commentRss>http://ralphholzmann.com/2009/12/10/strip-specific-html-tags-from-string/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
