Diary of a geek

July 2009
Mon Tue Wed Thu Fri Sat Sun

Andrew Pollock


Other people's blogs


RSS feed

Contact me

JavaScript required

Thursday, 09 July 2009

Facebook seems to render RSS feeds incorrectly (when newlines are involved)

I've been sufficiently annoyed by this to try and file a bug against Facebook (we'll see how well that works) and to go to the trouble of documenting the problem as I see it...

I have my blog importing into Facebook as what they call a "note". I figured, I could, so why not? It also gives me spam-free comment support for free (not that I particularly care about comments, people seem to be able to figure out how to email me if they really want to say something to me about a post).

I have a very rudimentary blogging setup. I'm using Blosxom (an old version at that). I hand-write my posts, and the HTML, in Vim. It works for me, and I can't be bothered changing it. Vim is set to wrap lines at 76 characters. I'm writing raw HTML, so sometimes it wraps sooner than it might if I was writing raw text.

The fact that I've got newlines in my HTML source doesn't seem to affect the way my blog is displayed, nor does it seem to mess up in anything else that consumes the RSS feed. Consider this recent post:

HTML source of a recent blog post

There's a newline after "in", there's a newline after "ask".

Here's how it gets mangled by Facebook:

The same blog post rendered in Facebook

It seems to have correctly ignored the newline characters, except everything else seems to treat the newline as whitespace. Facebook seems to just eat it completely, which mangles the words together.

This phenomenon is not observed in Planet:

The same blog post rendered in Planet

Nor in Google Reader:

The same blog post rendered in Google Reader

and of course it looks fine in its native environment:

The blog post as it appears on my blog

So I'm really inclined to say that Facebook is doing it wrong. I haven't read an HTML specification yet to try and figure out if how this should be done is specifically codified, but it seems to make the most sense to treat a newline as whitespace - it's being used to break words.

[00:01] [geek] [permalink]