<?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: Bloglines doesn't handle inter-element white space properly</title>
    <link>http://blog.moertel.com/articles/2007/09/11/bloglines-doesnt-handle-inter-element-white-space-properly</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>
    <item>
      <title>"Bloglines doesn't handle inter-element white space properly" by Tom Moertel</title>
      <description>&lt;blockquote&gt;
		&lt;p&gt;As for working around someone else’s bugs, I agree, but that’s often your lot on the ’net &amp;#8230;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;Indeed.  In working around one vendor&amp;#8217;s bugs, however, it&amp;#8217;s all too easy to bump into another vendor&amp;#8217;s bugs.  It&amp;#8217;s not just a matter of changing my output until Bloglines can finally interpret it correctly.  It&amp;#8217;s a matter of emitting output that reduces breakage across all of the buggy consumers in the wild.  For that reason, I&amp;#8217;m not inclined to change the format of output that is already simple, correct, &lt;em&gt;and&lt;/em&gt; correctly interpreted by just about everybody &amp;#8211; except Bloglines.&lt;/p&gt;


	&lt;p&gt;Moreover, history suggests that Bloglines needs the stick now and again to motivate it to do the right thing.  Thus I &lt;em&gt;am&lt;/em&gt; inclined to put Bloglines&amp;#8217;s breakage on display: maybe if enough users complain (or switch to Google Reader), the company will get the message.&lt;/p&gt;


	&lt;p&gt;Cheers,&lt;br /&gt;
Tom&lt;/p&gt;</description>
      <pubDate>Sat, 06 Oct 2007 13:23:08 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:4655deb5-5761-4552-9edb-85b4ef0bd82d</guid>
      <link>http://blog.moertel.com/articles/2007/09/11/bloglines-doesnt-handle-inter-element-white-space-properly#comment-588</link>
    </item>
    <item>
      <title>"Bloglines doesn't handle inter-element white space properly" by Aristotle Pagaltzis</title>
      <description>&lt;p&gt;Well, just like all other tags, &lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt; still works inside &lt;code&gt;&amp;lt;​pre&amp;gt;&lt;/code&gt; tags. You just have to drop the literal linebreaks you’re replacing, or else you’ll get double linebreaks on display.&lt;/p&gt;


	&lt;p&gt;As for working around someone else’s bugs, I agree, but that’s often your lot on the ’net if that buggy someone is much bigger than you – cf. all the interaction designer effort wasted on making CSS work in IE6. Sigh.&lt;/p&gt;</description>
      <pubDate>Tue, 11 Sep 2007 16:26:04 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:d92b2791-cff8-475a-ac8d-babd5ec07870</guid>
      <link>http://blog.moertel.com/articles/2007/09/11/bloglines-doesnt-handle-inter-element-white-space-properly#comment-579</link>
    </item>
    <item>
      <title>"Bloglines doesn't handle inter-element white space properly" by Tom Moertel</title>
      <description>&lt;p&gt;Aristotle Pagaltzis,&lt;/p&gt;


	&lt;p&gt;Thanks for your comment.&lt;/p&gt;


	&lt;p&gt;Bloglines doesn&amp;#8217;t just eat the horizontal white space but the vertical as well, as long as it&amp;#8217;s between elements.  So I can&amp;#8217;t just drop non-breaking spaces into my markup to work around the problem.  It was a good thought, though.&lt;/p&gt;


	&lt;p&gt;(Also, I don&amp;#8217;t feel like munging perfectly sensible markup to work around somebody else&amp;#8217;s bugs.)&lt;/p&gt;


	&lt;p&gt;Cheers,&lt;br /&gt;
Tom&lt;/p&gt;</description>
      <pubDate>Tue, 11 Sep 2007 15:30:57 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:55b09ffa-4c85-42e7-8954-5a43c64ae749</guid>
      <link>http://blog.moertel.com/articles/2007/09/11/bloglines-doesnt-handle-inter-element-white-space-properly#comment-578</link>
    </item>
    <item>
      <title>"Bloglines doesn't handle inter-element white space properly" by Aristotle Pagaltzis</title>
      <description>&lt;p&gt;Try replacing those inter-element blanks with non-breaking spaces. (Using a numeric character reference is probably the safest option.)&lt;/p&gt;</description>
      <pubDate>Tue, 11 Sep 2007 14:57:29 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:0ca3e0f8-1f1b-41c8-b8a7-a1309f827e10</guid>
      <link>http://blog.moertel.com/articles/2007/09/11/bloglines-doesnt-handle-inter-element-white-space-properly#comment-577</link>
    </item>
  </channel>
</rss>
