Often while coding view templates in html, my habit of adding some helpful comments causes lots of time-consuming effort while testing.
Consider this code...
Depends on the extension. If it's .html, you can use <?
to start and ?>
to end a comment. That's really the only alternative that I can think of. http://jsfiddle.net/SuEAW/
Eclipse Juno has a good way for it. You just do the cmd+/
The following works well in a .php file.
<php? /*your block you want commented out*/ ?>
/*
(opener)
*/
(closer)
for example,
<html>
/*<p>Commented P Tag </p>*/
<html>
Depending on your editor, this should be a fairly easy macro to write.
Another macro to reverse these steps, and you are done.
Edit: this simplistic approach does not handle nested comment tags, but should make the commenting/uncommenting easier in the general case.
I find this to be the bane of XML style document commenting too. There are XML editors like eclipse that can perform block commenting. Basically automatically add extra per line and remove them. May be they made it purposefully hard to comment that style of document it was supposed to be self explanatory with the tags after all.