<?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>憂藍夢境‧部落格 &#187; W3C</title>
	<atom:link href="http://blog.linym.net/archives/tag/w3c/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.linym.net</link>
	<description>我的學習心得、筆記</description>
	<lastBuildDate>Fri, 09 Dec 2011 12:33:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>修改 SyntaxHighlighter 符合 XHTML 驗證</title>
		<link>http://blog.linym.net/archives/415</link>
		<comments>http://blog.linym.net/archives/415#comments</comments>
		<pubDate>Thu, 08 Jan 2009 06:17:04 +0000</pubDate>
		<dc:creator>lym520</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[程式筆記]]></category>
		<category><![CDATA[網頁設計]]></category>
		<category><![CDATA[SyntaxHighlighter]]></category>
		<category><![CDATA[W3C]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.linym.net/?p=415</guid>
		<description><![CDATA[本站顯示程式碼是用「SyntaxHighlighter」，有人將它寫成 WP plugin，使用上非常方便，不過 SyntaxHighlighter 預設的呼叫語法是用 &#60;pre name="code" class="html"&#62;......&#60;/pre&#62; 由於 W3C 規範中 pre tag 是沒有 name 屬性的，所以鐵定要跟驗證貼紙說 bye bye，如果真的很在意的話可以這樣修改： 1. 修改 syntaxhighlighter.php 找到 &#60;pre name="code" 改成 &#60;pre title="code" 2. 修改 files/shCore.js 找到 tags[i].getAttribute('name') 改成 tags[i].getAttribute('title') 以 title 替換 name 屬性，這樣就能通過驗證了。 參考文章：Google SyntaxHighlighter - workaround for XHTML validation issue]]></description>
			<content:encoded><![CDATA[<p>本站顯示程式碼是用「<a href="http://code.google.com/p/syntaxhighlighter/" target="_blank">SyntaxHighlighter</a>」，有人將它寫成 <a href="http://wordpress.org/extend/plugins/syntaxhighlighter/" target="_blank">WP plugin</a>，使用上非常方便，不過 SyntaxHighlighter 預設的呼叫語法是用</p>
<pre>&lt;pre <strong>name</strong>="code" class="html"&gt;......&lt;/pre&gt;</pre>
<p>由於 W3C 規範中 pre tag 是沒有 name 屬性的，所以鐵定要跟驗證貼紙說 bye bye，如果真的很在意的話可以這樣修改：</p>
<p><strong>1. 修改 syntaxhighlighter.php</strong></p>
<pre>
找到
&lt;pre name="code"
改成
&lt;pre <strong>title</strong>="code"
</pre>
<p><strong>2. 修改 files/shCore.js</strong></p>
<pre>
找到
tags[i].getAttribute('name')
改成
tags[i].getAttribute('<strong>title</strong>')
</pre>
<p>以 title 替換 name 屬性，這樣就能通過驗證了。</p>
<p>參考文章：<a href="http://aumlette.me.uk/weblog/google-syntaxhighlighter-workaround-for-xhtml-validation-issue/">Google SyntaxHighlighter - workaround for XHTML validation issue</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.linym.net/archives/415/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

