Friday, November 13, 2009

Another rant… This time about WLW! (Updated!)

WLW being Windows Live Writer.

I’m not saying it’s bad (It’s actually rather good, IMHO), but there seems to be some kind of funky interaction between it and Blogger.

The source for a post, when it’s inside WLW looks like this:

<p>WLW being Windows Live Writer.</p>
<p>I’m not saying it’s bad (It’s actually rather good, IMHO), 
but there seems to be some kind of funky interaction between it and Blogger.</p>
<p>The source for a post, when it’s inside WLW looks like this:</p>

But, when it’s posted to blogger, it comes out like this:

<p>WLW being Windows Live Writer.</p>
<br />
<br />
<p>I’m not saying it’s bad (It’s actually rather good, IMHO), 
but there seems to be some kind of funky interaction between it and Blogger.</p>
<br />
<br />
<p>The source for a post, when it’s inside WLW looks like this:</p>

Obviously, this isn’t right. It looks like blogger is replacing every newline character with a <br /> and a newline. This would be fine if I was composing in plain text, but the editor I’m using is already doing the work at making sure everything is nicely XHTML formatted – I don’t need the extra newlines.

This was, for a while, making everything look FAR too spaced out, until I tweaked my CSS like so:

.post-body br {
   display: none;
}
.post-body p > br {
   display: auto;
}

What does this do?

It tells browsers to not display any “BR” elements inside the “.post-body” div, and then overrides that to say DO display “BR”s that are directly inside “P” (Paragraph) elements.

This fixes the problem, but I have a feeling I’m going about this the wrong way. Anyone out there use WLW with a similar problem? How did you fix it?

[Update] Well, I found the problem. Hidden deep within the settings of Blogger, there is the option “Convert Line Breaks” that defaults to “Yes”, with the description:

If Yes is selected, single hard-returns entered in the Post Editor will be replaced with single <br /> tags in your blog, and two hard-returns will be replaced with two tags (<br /><br />).

The wording of this implies it’s only going to do it for items posted through the Blogger “Post Editor”, but it seems this enables this behaviour everywhere, including through the Blogger API.

Now that this is switched off, everything looks just right again.

So, my apologies WLW, it wasn’t your fault at all. Blogger: What were you thinking?

No comments:

Post a Comment