<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Tom Moertel's Weblog: Tag html</title>
    <link>http://blog.moertel.com/articles/tag/html?tag=html</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Quality rants on programming theory and stuff geeks like</description>
    <item>
      <title>Bloglines doesn't handle inter-element white space properly</title>
      <description>&lt;p&gt;If you&amp;#8217;re reading my blog via &lt;a href="http://bloglines.com/"&gt;Bloglines&lt;/a&gt;, you
may have noticed that some of my posts look terrible, especially when
they contain code snippets.  I am sorry for that, but it&amp;#8217;s not my
fault. Bloglines doesn&amp;#8217;t handle white space properly.&lt;/p&gt;


	&lt;p&gt;Here&amp;#8217;s the more detailed explanation.  When you request one of my
feeds in, say, Atom format, you get back a bunch of &lt;span class="caps"&gt;XML&lt;/span&gt; that contains
the most-recent posts from my blog.  Each post is represented as
lovingly crafted &lt;span class="caps"&gt;HTML&lt;/span&gt;, escaped per the Atom specs.  When Bloglines
gets its hands on this very same &lt;span class="caps"&gt;HTML&lt;/span&gt;, it attempts to scrub it nice
and clean &amp;#8211; get rid of any naughty bits, you know.  And there&amp;#8217;s
nothing wrong with that.  Except when the scrubbing goes horribly,
horribly wrong.  Which is exactly what happens when Bloglines
encounters perfectly legitimate markup that represents
syntax-highlighted code snippets.&lt;/p&gt;


	&lt;p&gt;What does Bloglines do then?  It strips out &lt;em&gt;all&lt;/em&gt; of the significant white
space, turning each block of code into a single, mile-long,
unbreakable line of NoSpaceText that forces your web browser to expand
the page until it is wide enough to enshroud a small solar system.  Then
&lt;em&gt;you&lt;/em&gt; are forced to scroll forever to read each line of the text
column.  Ugg.&lt;/p&gt;


	&lt;p&gt;More specifically, each syntax-highlighted code block is
represented in &lt;span class="caps"&gt;HTML&lt;/span&gt; as a preformatted (PRE) text block.
Each word in that block is wrapped in a &lt;span class="caps"&gt;SPAN&lt;/span&gt; element
whose class attribute indicates the word&amp;#8217;s role in the
original source code.  Keywords get one
class, identifiers another, and so on. For example,
the code &amp;#8220;&lt;tt&gt;import List&lt;/tt&gt;&amp;#8221; might be represented
as follows:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;&amp;lt;span class="kwd"&amp;gt;import&amp;lt;/span&amp;gt; &amp;lt;span class="name"&amp;gt;List&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;But when Bloglines gets its hands on that markup, it strips
out the whitespace between the &lt;span class="caps"&gt;SPAN&lt;/span&gt; elements:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;&amp;lt;span class="kwd"&amp;gt;import&amp;lt;/span&amp;gt;&amp;lt;span class="name"&amp;gt;List&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Thus the markup renders as &amp;#8220;&lt;tt&gt;importList&lt;/tt&gt;&amp;#8221; when it hits your web
browser.  Now imagine the same space-denuding bad behavior applied to
&lt;em&gt;all&lt;/em&gt; of the inter-element white space in a full-length block of code.
That&amp;#8217;s right, what you end up with is a single, insanely long
LineOfUnbreakableText that your web browser chokes on. Again:
Ugg.&lt;/p&gt;


	&lt;p&gt;The folks at Bloglines &lt;a href="http://intertwingly.net/blog/2006/04/13/Bloglines-Breakages"&gt;have had similar problems in the past&lt;/a&gt;, most of which have been fixed.  I hope they fix this particular problem soon, too.&lt;/p&gt;


	&lt;p&gt;Until that time, however, you might want to consider other feed readers.&lt;/p&gt;</description>
      <pubDate>Tue, 11 Sep 2007 12:51:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:6f848f04-4c76-496e-b518-7d86d1899be6</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2007/09/11/bloglines-doesnt-handle-inter-element-white-space-properly</link>
      <category>rants</category>
      <category>bloglines</category>
      <category>rants</category>
      <category>markup</category>
      <category>atom</category>
      <category>xml</category>
      <category>html</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/576</trackback:ping>
    </item>
  </channel>
</rss>
