Friday, February 06, 2009

Windows Live Writer first paragraph problem

I was having trouble with WLW messing up the mark-up for the first paragraph when I start a new blog entry.

Once I had typed the first paragraph then pressed enter, rather than starting a new paragraph tag after the first, it inserted a new one in the first one before the text. After that the paragraphs come up in pretty much the right order, but the nesting is all wrong and not at all what you would want.

Here is an example of the mess that it manages:

<p>
  <p>Second paragraph.</p>
 
  <p></p>
Third paragraph.
 
  <p>First paragraph.</p></p>

What you want really is this:

<p>First paragraph.</p>
 
<p></p>
 
<p>Second paragraph.</p>
 
<p></p>
 
<p>Third paragraph.</p>

I have finally worked out what was causing this. It was the fact that I was clicking in the edit area before typing! So if you edit the title, you need to NOT click in the post body area, you can just hit Enter after you are done with the title and it seems to work.

Unfortunately, clicking will have bad effects on the mark-up whenever you do it in a blank area… You need to be clicking in an existing paragraph or else it seems to get a bit stuffed up. I am still trying to work out exactly which action causes which problems and hot to possibly avoid them. One is to paste in the html for a paragraph with some text in it rather than clicking at the end of a post to add a new paragraph. This is a beta product though so I guess one is meant to deal with quirkiness.

Another related note: you really have to hit Enter at the end of a paragraph, even the last one. If you don’t you can end up with:

<p>Paragraph 1.</p>
 
<p></p>
Paragraph 2.
 

I like WLW. I am sure there is not much more to go before it is kind to your mark-up. The sad thing is that this kind of stuff is probably not that important to a lot of people.

No comments:

Post a Comment