Finicky Commenting Code in Topics

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
rmdavidson
Sr. Propeller Head
Posts: 127
Joined: Tue Jan 17, 2012 7:58 am
Location: Pittsburgh, PA

Finicky Commenting Code in Topics

Post by rmdavidson »

I have a topic that is getting a bit long and I want to add each section header in as a comment so I can find things quicker in the code when I need to tweak it there. I used standard HTML/XML commenting format and Flare is yelling at me that my format isn't correct when I use:

Code: Select all

<!-------------------Initializing Enterprise Settings------------------->
It says, "... an XML comment cannot contain '--' , and '-' cannot be the last character." However, I somehow stumbled on the fact that if I use 3 hyphens at the start and 2 hyphens at the end, it takes the comment. Even 3 at the end and it complains.

Code: Select all

<!---Initializing Enterprise Settings-->
Any ideas why?

Thanks,

Robin
Robin Davidson
Technical Writer & Documentation Specialist
STC Pittsburgh Chapter President http://www.stcpgh.org

Flare 7.2 / Windows 7 Pro 64 bit
crdmerge
Sr. Propeller Head
Posts: 248
Joined: Tue Dec 16, 2008 5:37 am

Re: Finicky Commenting Code in Topics

Post by crdmerge »

Bing search on "html comment syntax" results in:

This means that the following are all legal SGML comments:
<!-- Hello -->
<!-- Hello -- -- Hello-->
<!---->
<!------ Hello -->
<!>

Two dashes apparently are the max in the end section, but more are allowed at the start. I've only ever seen two & two, everywhere, however.


Good luck,
Leon
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Finicky Commenting Code in Topics

Post by LTinker68 »

Looks like the correct format is <!-- Comment here -->.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
rmdavidson
Sr. Propeller Head
Posts: 127
Joined: Tue Jan 17, 2012 7:58 am
Location: Pittsburgh, PA

Re: Finicky Commenting Code in Topics

Post by rmdavidson »

It shouldn't matter how many hyphens there are on either end. I've used however many I want to ever since I started with HTML in 1997 so to me this is rather odd.

Robin
Robin Davidson
Technical Writer & Documentation Specialist
STC Pittsburgh Chapter President http://www.stcpgh.org

Flare 7.2 / Windows 7 Pro 64 bit
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Finicky Commenting Code in Topics

Post by LTinker68 »

It looks like it's that way for XHTML. It's more finicky than plain HTML. Why they felt the comment shouldn't have more than two dashes, I don't know, but it sounds like it might be the standard, at least for XHTML.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Finicky Commenting Code in Topics

Post by RamonS »

When in doubt look at the W3C standard. See here: http://dev.w3.org/html5/markup/syntax.html#comments

Shows that anything other than <!-- at the beginning and --> at the end is not valid. And before someone claims Flare is still broken because it allowed <!--- at the beginning, the third - is considered part of the comment text.

Well possible that some browsers and editors allow other comment markup, but then only because they blatantly ignore the standard - unfortunately way too common.
Post Reply