Wednesday, February 18, 2009

Adding text to a WLW post without screwing up the mark-up!

Finally! I have discovered a way to add text at the end or middle of a post without causing horrible nesting problems with the <p> tags.

If you just go clicking at the end of an existing paragraph, or even on it, or even clicking in a space that looks blank, it is pretty easy to end up with this kind of mess:

<p>
  <p>para1</p>
 
  <p>para2</p></p>

But now I have managed to work out how to avoid it! As an example, to add a paragraph to the end of a post:

  • Hover over the invisible box that represents the blank <p></p> that WLW sticks after each paragraph with text in it. You are looking for the North South East West arrow cursor.

  • Click to select it. You need to end up with the eight little squares in the corners and on the edges showing that the whole element is selected, not the insertion point indicating that it is trying to add text inside the element.

  • Now press the right arrow key. You should end up with the insertion point below the element you clicked on. Now you can type and the text will go into the paragraph element and pressing enter at the end will close the current paragraph, insert a blank one and start a new one. Remember also that you do need to press enter at the end of the paragraph, even the last one, to get the tag to close properly.

To insert a paragraph between two existing ones, you want to do the same thing with the invisible blank paragraph element between two with text in. When you press the right arrow it will look like you are in the next paragraph with text, but you aren’t. Once you get to the end of your paragraph and hit enter all will be well again.

I feel like I am 90% of the way to being able to use WLW without switching to the source pane all the time – which is how you bloody well should be able to use it. It is just a bit unfortunate that I have to do it by being careful where I click and type and so on.

No comments:

Post a Comment