Real HTML comments

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Real HTML comments

Sylvain Brunerie
Hi,
Is there a way to insert into a page real HTML comments ? I mean, HTML-style
comments like <!-- ... --> are stripped on rendering the page. I'd like to
insert comments staying as comments in the source code of the generated
page.

Thanks,
Sylvain Brunerie – [[fr:User:Delhovlyn]]
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

KALAN-4
On Fri, Nov 14, 2008 at 03:40, Sylvain Brunerie
<[hidden email]> wrote:
> Is there a way to insert into a page real HTML comments ? ... I'd like to
> insert comments staying as comments in the source code of the generated
> page.

<span style="display:none">comment</span> works pretty well and can
satisfy most reasons for inserting a comment into a page.

— Kalan
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

Sylvain Brunerie
Hmm, this can be a way to get around the problem... =) But this has
inconvenients. Isn't there any wikisyntax to do this, to write really HTML
comments ? For the syntax highlighting of the source code in FF, for
example, it would be important. Or maybe we can request this feature ?

2008/11/13 Kalan <[hidden email]>

> On Fri, Nov 14, 2008 at 03:40, Sylvain Brunerie
> <[hidden email]> wrote:
> > Is there a way to insert into a page real HTML comments ? ... I'd like to
> > insert comments staying as comments in the source code of the generated
> > page.
>
> <span style="display:none">comment</span> works pretty well and can
> satisfy most reasons for inserting a comment into a page.
>
> — Kalan
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

KALAN-4
On Fri, Nov 14, 2008 at 03:53, Sylvain Brunerie
<[hidden email]> wrote:
> Isn't there any wikisyntax to do this, to write really HTML
> comments ?
No, for now.

> For the syntax highlighting of the source code in FF, for
> example, it would be important.
There is a <source> tag...

> Or maybe we can request this feature ?
Sure we can, it shouldn't be hard in any way.

— Kalan
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

Roan Kattouw
Kalan schreef:
>> For the syntax highlighting of the source code in FF, for
>> example, it would be important.
>>    
> There is a <source> tag...
>  
I guess he meant syntax highlighting in Firefox's View Source screen, in
which <source> tags are of course irrelevant.

Roan Kattouw (Catrope)

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

Marco Schuster-2
In reply to this post by KALAN-4
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Nov 13, 2008 at 9:57 PM, Kalan  wrote:
>> Isn't there any wikisyntax to do this, to write really HTML
>> comments ?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: http://getfiregpg.org

iD8DBQFJHJWKW6S2GapJUuQRAoPZAJ9wb+YPlLn4k1D37sxTHWF/d1BUAQCeNkHi
20gBrRnQt0AXFV5Hdhlbetc=
=pSGe
-----END PGP SIGNATURE-----

>> Or maybe we can request this feature ?
> Sure we can, it shouldn't be hard in any way.

I take a look at it when I finish my physics exam on Monday.
Any syntax suggestions? I'd propose <htmlcomment></htmlcomment>.
Or would anyone here like to not strip <!-- -->s any more?

Marco

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

Sylvain Brunerie
In reply to this post by KALAN-4
> There is a <source> tag...
No, I mean, when I do Ctrl+U in Firefox, to see the source code of a page, I
want to see my "real HTML comments" like real HTML comments, green italic.
=)

> Sure we can, it shouldn't be hard in any way.
I'll think about this. (I didn't found anything similar on Bugzilla.)

Sylvain Brunerie
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

KALAN-4
On Fri, Nov 14, 2008 at 04:02, Sylvain Brunerie
<[hidden email]> wrote:
>> There is a <source> tag...
> No, I mean, when I do Ctrl+U in Firefox, to see the source code of a page, I
> want to see my "real HTML comments" like real HTML comments, green italic.
> =)
Ahh, this... I thought it was a Firefox-specific feature that I didn't
know of, not a thing available in any major browser. :)

On Fri, Nov 14, 2008 at 04:00, Marco Schuster
<[hidden email]> wrote:
> I take a look at it when I finish my physics exam on Monday.
> Any syntax suggestions? I'd propose <htmlcomment></htmlcomment>.
> Or would anyone here like to not strip <!-- -->s any more?
Stripping <!-- -->s conserves bytes for transclusion, when used in
templates, and occasional stripping turnoff may break things.
<htmlcomment></htmlcomment> or, perhaps, <comment></comment> is a
better and easier-to-implement option.

— Kalan
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

Sylvain Brunerie
In reply to this post by Marco Schuster-2
2008/11/13 Marco Schuster <[hidden email]>

> I take a look at it when I finish my physics exam on Monday.
> Any syntax suggestions? I'd propose <htmlcomment></htmlcomment>.
> Or would anyone here like to not strip <!-- -->s any more?
>
> Marco
>

Thanks. =)
Concerning the syntax, I was rather thinking about something more concise,
similar to <!-- --> but different.
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

Roan Kattouw
Sylvain Brunerie schreef:

>> I take a look at it when I finish my physics exam on Monday.
>> Any syntax suggestions? I'd propose <htmlcomment></htmlcomment>.
>> Or would anyone here like to not strip <!-- -->s any more?
>>
>> Marco
>>
>>    
>
> Thanks. =)
> Concerning the syntax, I was rather thinking about something more concise,
> similar to <!-- --> but different.
That would be significantly harder to implement, and also potentially
confusing. Writing an extension that implements <comment></comment> is
ridiculously easy, whereas introducing new syntax of another kind would
be very hard on pretty much everyone whose name isn't Tim Starling :)

Roan Kattouw (Catrope)

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

Tei-2
On Thu, Nov 13, 2008 at 10:09 PM, Roan Kattouw <[hidden email]> wrote:

> Sylvain Brunerie schreef:
>>> I take a look at it when I finish my physics exam on Monday.
>>> Any syntax suggestions? I'd propose <htmlcomment></htmlcomment>.
>>> Or would anyone here like to not strip <!-- -->s any more?
>>>
>>> Marco
>>>
>>>
>>
>> Thanks. =)
>> Concerning the syntax, I was rather thinking about something more concise,
>> similar to <!-- --> but different.
> That would be significantly harder to implement, and also potentially
> confusing. Writing an extension that implements <comment></comment> is
> ridiculously easy, whereas introducing new syntax of another kind would
> be very hard on pretty much everyone whose name isn't Tim Starling :)
>

another idea for comments:

<script>//  Looks mom, no hands!  </script>

<script>/*  This is not a TEST, i am inocent */ </script>


now, for "example source code", theres the good old XMP

<xmp>
what you see is what you see, YO!.
FR<BR>UK
that is, brasil is better than anyone
</xmp>





--
--
ℱin del ℳensaje.
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

Platonides
In reply to this post by Roan Kattouw
Roan Kattouw wrote:
> That would be significantly harder to implement, and also potentially
> confusing. Writing an extension that implements <comment></comment> is
> ridiculously easy, whereas introducing new syntax of another kind would
> be very hard on pretty much everyone whose name isn't Tim Starling :)
>
> Roan Kattouw (Catrope)

Agree. Much better to add a <htmlcomment> and changing it to a shorter
name if needed would be trivial.

Now, some implementation details:
What to with a --> inside a html comment? And -- ?


_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

Steve Sanbeg
On Thu, 13 Nov 2008 22:53:15 +0100, Platonides wrote:

> Roan Kattouw wrote:
>> That would be significantly harder to implement, and also potentially
>> confusing. Writing an extension that implements <comment></comment> is
>> ridiculously easy, whereas introducing new syntax of another kind would
>> be very hard on pretty much everyone whose name isn't Tim Starling :)
>>
>> Roan Kattouw (Catrope)
>
> Agree. Much better to add a <htmlcomment> and changing it to a shorter
> name if needed would be trivial.
>
> Now, some implementation details:
> What to with a --> inside a html comment? And -- ?

Well, <source lang=html4strict><!-- comment --></source> seems to work
like I'd expect, so the normal extension handling should get it right.
Strip <comment>, remove <!-- .. -->, unstrip <comment>


_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

Roan Kattouw
Steve Sanbeg schreef:

> On Thu, 13 Nov 2008 22:53:15 +0100, Platonides wrote:
>
>  
>> Roan Kattouw wrote:
>>    
>>> That would be significantly harder to implement, and also potentially
>>> confusing. Writing an extension that implements <comment></comment> is
>>> ridiculously easy, whereas introducing new syntax of another kind would
>>> be very hard on pretty much everyone whose name isn't Tim Starling :)
>>>
>>> Roan Kattouw (Catrope)
>>>      
>> Agree. Much better to add a <htmlcomment> and changing it to a shorter
>> name if needed would be trivial.
>>
>> Now, some implementation details:
>> What to with a --> inside a html comment? And -- ?
>>    
>
> Well, <source lang=html4strict><!-- comment --></source> seems to work
> like I'd expect, so the normal extension handling should get it right.
> Strip <comment>, remove <!-- .. -->, unstrip <comment>
Hmm, that's starting to sound scary. Doesn't <nowiki><!-- comment
--></nowiki> work? If it doesn't, we could ask Tim to make it work
(shouldn't be too hard).

Roan Kattouw (Catrope)

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

Steve Sanbeg
On Thu, 13 Nov 2008 23:40:04 +0100, Roan Kattouw wrote:

> Steve Sanbeg schreef:
>> On Thu, 13 Nov 2008 22:53:15 +0100, Platonides wrote:
>>
>>  
>>> Roan Kattouw wrote:
>>>    
>>>> That would be significantly harder to implement, and also potentially
>>>> confusing. Writing an extension that implements <comment></comment> is
>>>> ridiculously easy, whereas introducing new syntax of another kind would
>>>> be very hard on pretty much everyone whose name isn't Tim Starling :)
>>>>
>>>> Roan Kattouw (Catrope)
>>>>      
>>> Agree. Much better to add a <htmlcomment> and changing it to a shorter
>>> name if needed would be trivial.
>>>
>>> Now, some implementation details:
>>> What to with a --> inside a html comment? And -- ?
>>>    
>>
>> Well, <source lang=html4strict><!-- comment --></source> seems to work
>> like I'd expect, so the normal extension handling should get it right.
>> Strip <comment>, remove <!-- .. -->, unstrip <comment>
> Hmm, that's starting to sound scary. Doesn't <nowiki><!-- comment
> --></nowiki> work? If it doesn't, we could ask Tim to make it work
> (shouldn't be too hard).
>
> Roan Kattouw (Catrope)

This doesn't seem scary, but I really should read the new preprocessor
more thoroughly.  Anyway, it seems like both
<!--<nowiki>-->''text''<!--</nowiki>-->

and

<nowiki><!-- comment --></nowiki>

work properly, so nesting and comments doesn't seem to be much of an issue.



_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

Roan Kattouw
Steve Sanbeg schreef:
> Anyway, it seems like both
> <!--<nowiki>-->''text''<!--</nowiki>-->
>
> and
>
> <nowiki><!-- comment --></nowiki>
>
> work properly, so nesting and comments doesn't seem to be much of an issue.
If the latter works properly, then why are we even considering a
<comment> tag? Does <nowiki><!-- comment --></nowiki> work properly in
the sense that comments are stripped after <nowiki> tags are parsed, so
you'll actually get a comment in the HTML output?

Roan Kattouw (Catrope)

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

Bugzilla from andrew@epstone.net
In reply to this post by Platonides
On Fri, Nov 14, 2008 at 8:53 AM, Platonides <[hidden email]> wrote:
> Agree. Much better to add a <htmlcomment> and changing it to a shorter
> name if needed would be trivial.
>
> Now, some implementation details:
> What to with a --> inside a html comment? And -- ?

Forgive me for asking the obvious, but why on Earth do we want to be
able to insert HTML comments? Comments are used in markup/programming
languages, and are for the benefit of those who edit the code
subsequently. Of course, nobody edits the parsed HTML, at least not
directly, so it doesn't make much sense to put comments in there.

Step back from implementation, and first ask "What's the use case?"
Without a use case, you can't hope to think of a sensible
implementation, because so much of implementation depends on how the
feature is to be used.

--
Andrew Garrett

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

Brion Vibber-3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Garrett wrote:

> Forgive me for asking the obvious, but why on Earth do we want to be
> able to insert HTML comments? Comments are used in markup/programming
> languages, and are for the benefit of those who edit the code
> subsequently. Of course, nobody edits the parsed HTML, at least not
> directly, so it doesn't make much sense to put comments in there.
>
> Step back from implementation, and first ask "What's the use case?"
> Without a use case, you can't hope to think of a sensible
> implementation, because so much of implementation depends on how the
> feature is to be used.

The one case I might think of is microformats that make use of
comments... but that's bad practice, since parsers can legitimately
strip comments. :D

- -- brion
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkcw+4ACgkQwRnhpk1wk467dwCfcK2K7mF02Yr2MVmSYNibCHaR
1IcAoOBnJaxQaFN9vKdl9bwN6tDaIAgf
=1xD6
-----END PGP SIGNATURE-----

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

Aryeh Gregor
In reply to this post by Sylvain Brunerie
On Thu, Nov 13, 2008 at 3:40 PM, Sylvain Brunerie
<[hidden email]> wrote:
> Is there a way to insert into a page real HTML comments ? I mean, HTML-style
> comments like <!-- ... --> are stripped on rendering the page. I'd like to
> insert comments staying as comments in the source code of the generated
> page.

No, there absolutely is not.  That would be unsafe: users could insert
arbitrary HTML content in comments and have IE pick it up using IE
conditionals.  If there were an actual use-case that was of any value,
we could strip IE conditional comments and let all others pass . . .
which would be safe only assuming there are no other scary abuses of
comments out there, and that we get the conditional comment stripping
right.  If there are no use-cases, it's not worth it.

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Real HTML comments

Sylvain Brunerie
2008/11/14 Aryeh Gregor
<[hidden email]<Simetrical%[hidden email]>
>

> That would be unsafe: users could insert
> arbitrary HTML content in comments and have IE pick it up using IE
> conditionals.  If there were an actual use-case that was of any value,
> we could strip IE conditional comments and let all others pass . . .
> which would be safe only assuming there are no other scary abuses of
> comments out there, and that we get the conditional comment stripping
> right.  If there are no use-cases, it's not worth it.
>

That's true. I didn't know these conditional comments for IE.
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
12