Don't break HTML comments out to separate lines
|Reported by:||fastballweb||Owned by:|
The following is a convention I've seen used several places, including the default Wordpress theme:
<div id="divname"> </div><!-- #divname -->
The point is to make it clear which div element is being closed - very helpful in complicated markup where proper indenting cannot be maintained.
Occasionally I will use this convention in markup that makes it into CKEditor, whether through template snippets or pasted HTML. But the editor does this to it:
<div id="divname"> </div> <!-- #divname -->
Now that the comment is on the next line, it is much more likely to get separated from the closing div tag it belongs to. It is also easier to miss it entirely.
I love everything about CKEditor source indenting except for this behavior of forced newlines for HTML comments.
My guess is that HTML comments by nature are almost always typed by hand. So it follows that:
- Linebreaks, or lack thereof, may carry meaning
- If the person wanted the comment on a new line, they easily could have entered it that way in the first place
In light of that, I suggest that this behavior be removed.