To

One of the little things about a HTML editor is the way that block formatting works. Most users probably don't realize when they run into these kinds of problems, but they do.

The reason why editors have a hard time is because they are trying to emulate a word processor with some things. There are simularities between HTML and word processing documents - both have paragraphs, headings, bold, etc. But there are important differences as well. Forcing things too much into a mold with word processors can hurt you.

One thing that we got feedback about, and that I did not like myself, was that VS.NET 2003 always seemed to add <P> tags everywhere. Even if you have a document with just a body in it, if you press enter while in design view, you get a <P> tag. Delete everything, get a <P> tag if you didn't have one.

What I didn't like, and what a lot of other users didn't like, is that they got a <P> tag when they didn't ask for one. It makes sense to split a <P> tag if you actually have one and are inside of it. But if I have no <P> tag, adding one just so there is something to split seems to be thinking a bit too much.

So the way whidbey works is this: If you press enter inside any block format tag (other than DIV) then the block will split around where you pressed enter. If you press enter at the end of some of these tags (like the heading tags) then a new <P> will start.

If you press enter inside of a DIV, or a table cell, or the body, then we insert a <BR>. If you hold down shift+enter, you always get a <BR> no matter where you are.

If you really want a <P> tag, the format dropdown on the formatting toolbar will create one if you are inside of a non-block tag and you select <P> from the list.

I think that this design works better for most people. If you already have paragraph stuff we respect it and handle it. If you never use paragraph formatting we never put it there for you unless you explicitly ask for it.

Comments

  • Anonymous
    May 05, 2004
    The comment has been removed
  • Anonymous
    May 05, 2004
    <gripe>
    I would prefer if VS.Net didn't change anything when I open up a document in design view. Why does it do this?

    I also don't understand why VS.Net insists on adding Name attributes to Placeholders (which causes the page to throw a "Name attribute not supported" exception) and assorted other rudenesses such as this.
    </gripe>
  • Anonymous
    May 05, 2004
    The point of my post was to point out that even when you edit the document, we change as little as possible in Whidbey. Even in Everett block formatting only changed if you edited the document.

    I am not aware of the Name attribute on Placeholder problem. Is this in Whidbey or VS.NET 2003?
  • Anonymous
    May 05, 2004
    Please, don't insert nbsp everywhere. Another thing that bothers me in whidbey, that you have by default div tag inside of the form when you just create a new page. I never asked for that. As you say, if I don't explicitly ask I don't want that thing to appear.
  • Anonymous
    May 05, 2004
    Thank you!!!
  • Anonymous
    May 05, 2004
    Sometimes we have to put an nbsp to preserve the spacing that is shown in design view. HTML condenses spaces, so if you have two spaces side by side, we have to save that using nbsp.

    Another reason you see nbsp is because empty block tags show as no space in the browser. So we have to put a non breaking space inside empty tags like these, or they will not display the same at browse time and run time.

    The default div tag is not added by design view. It is part of the standard aspx template.
  • Anonymous
    May 07, 2004
    You mean to <br/> or not to <br/> surely?

    :)
  • Anonymous
    May 17, 2004
    The comment has been removed
  • Anonymous
    August 05, 2004
    Cool.

    Please make it <br/> though!
  • Anonymous
    June 12, 2009
    PingBack from http://toenailfungusite.info/story.php?id=5702