adobe / brackets

An open source code editor for the web, written in JavaScript, HTML and CSS.
http://brackets.io
MIT License
33.25k stars 7.63k forks source link

[Core][Live HTML]: Should check html and body nodes when check Live HTML Syntax error. #5361

Open julieyuan opened 11 years ago

julieyuan commented 11 years ago

Steps:

  1. Launch Brackets and open default index.html file.
  2. Live Preview this file.
  3. Input a tag <html> or <body> between <body> tag, for example, insert this tag at line 15, it will automaticlly insert closing tag </html> or </body>, then observer the Live Preview icon on the sidebar.
  4. Delete the tag and observe the webpage.

Result: At step3, the Live Preview doesn't complaint any syntax error. After step4, the webpage becomes whilte or gray , and cannot update index.html anymore.

Expected: At step3, the Live Preview should complaint syntax error and icon become to pink. At step4, it should continue to update html file, or the Live Preview icon becomes to pink.

ENV: MAC10.7 and Win8 English OS Build: 0.32.0-9673

Snapshots: Please refer to snapshots for details: Step2: 111 Step3: 222 Step4: 3333 case bodytag : 444

dangoor commented 11 years ago

Good catch. We don't do a lot of semantic checking right now (<body> inside of <body>, for example), almost entirely just going by syntax. Our goal isn't to build a complete HTML parser (at least not now), but this case you bring up is a good one because it really breaks things where as most semantically incorrect HTML won't.

I'm split between "low priority" and "medium priority" on this one because a user won't likely mistakenly enter these tags. I'll leave this for bug review.

njx commented 11 years ago

Low pri to me.