Post about disable-output-escaping

This commit is contained in:
~lucidiot 2021-01-23 22:44:40 +00:00
parent 8e3c8ec59b
commit 9df91bfff5
1 changed files with 13 additions and 0 deletions

View File

@ -120,5 +120,18 @@
<p>With this change, instead of Yahoo, I can quickly subscribe to anyone's RSS feeds faster than ever. This will definitely not help my backlog of 2600+ articles…</p>
]]></description>
</item>
<item>
<title>disable-output-escaping</title>
<pubDate>Sat, 23 Jan 2021 21:40:04 +0000</pubDate>
<guid isPermaLink="false">d-o-e</guid>
<category domain="https://envs.net/~lucidiot/rsrsss/">Meta</category>
<category domain="https://envs.net/~lucidiot/rsrsss/">XSL</category>
<description><![CDATA[
<p>While writing the previous post about TinyTinyRSS in Pale Moon, I tried to fix an issue I still had with my XSLT: To make HTML tags in &lt;description&gt; blocks work, I had to break an important part of the RSS specification and add tags directly without escaping them. XSLT stylesheets would decode entities or CDATA blocks, and do not provide a function to selectively re-parse XML tags, so I felt I was stuck. I then found out that this bit of code could get me to output the content of a description tag without getting HTML entities, so getting raw HTML as I want it without causing bugs with Pale Moon's RSS preview or bad RSS validator warnings:</p>
<pre>&lt;xsl:value-of select="description" disable-output-escaping="yes" /&gt;</pre>
<p><code>disable-output-escaping</code> <a href="https://www.w3.org/TR/1999/REC-xslt-19991116#disable-output-escaping">is optional</a> according to the W3C specification since version 1. libxslt, Chromium and Internet Explorer do support it, but Firefox <a href="https://developer.mozilla.org/en-US/docs/Web/API/XSLTProcessor/XSL_Transformations_in_Mozilla_FAQ#can_i_do_disable-output-escaping.3f">chose not to</a>, and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=98168" target="_blank">a Bugzilla ticket</a> for it will celebrate its 20th birthday this year. They do say themselves that this causes issues for RSS support, so I chose to just not care about it. If you are a Firefox user and are seeing raw, unparsed HTML tags in there, I can only suggest using another browser, or just subscribing to this feed and reading this in its home, a RSS aggregator.</p>
]]></description>
</item>
</channel>
</rss>