naming-conventionscomment-conventionshtml

HTML comment conventions


I need to use HTML comments to store specific data, but I don't want use comment schemes that already exist, as generated by programs like Dreamweaver <!-- #BeginLibraryItem "/File.lbi" --> or Frontpage.

How do I know what comment scheme would be least problematic, or at least not look like other existing comment conventions?

PS: I'm told a double hypen "--" in comments sometimes breaks rendering.


Solution

  • You need at least <!-- --> to have a comment, and yes, you should avoid having "--" in the middle of the comment; the "--" are the actual comment delimiters. Other than that, you can just prefix it with any string and I think you'll be good -- e.g., <!--JEREMY_RUDD: -->.

    However, storing data in comments sounds like a suboptimal idea. Can you elaborate on this? Have you considered whether, say, something like JSON might not be more appropriate?