1

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.

Robin Rodricks
  • 110,798
  • 141
  • 398
  • 607

2 Answers2

3

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?

Shog9
  • 156,901
  • 35
  • 231
  • 235
John Feminella
  • 303,634
  • 46
  • 339
  • 357
  • 2
    I'll second the "suboptimal idea" comment. Comments are intended to be ignored - anything else is a hack, and opens you up to problems with other tools (such as Dreamweaver) that rely on similar hacks... – Shog9 Jun 06 '09 at 19:01
0

I've started a standard, inspired by JSDoc and Javadoc: HTMLDoc.

Jonathan
  • 32,202
  • 38
  • 137
  • 208