existuje "remark" pro html?

Petr Lampa lampa at fee.vutbr.cz
Tue Jun 18 18:01:50 CEST 1996


> > ><-- Toto je komentar -->
> > >
> > >Ne. <!--Toto je komentar-->.
>
> Ano. Takhle to funguje, kdyz staci 'zaremovat' jeden radek.
> Nekdy jich clovek ale potrebuje 'zaremovat' vic a s tim
> jsem mel vzdycky tolik problemu, ze jsem od podobnych pokusu
> nakonec zcela upustil. HTML _teoreticky_ nerozlisuje mista,
> kde jsou konce radek a kde ne, s jednou dokumentovanou vyjimkou,
> a to je <PRE>...</PRE>. Vypada to, ze druhou takovou vyjimkou
> budou prave komentare. Pokud pouzijete konstrukci
>
> <!--
> nejake radky,
> ktere chcete
> docasne zneviditelnit
> -->
>
> tak nejake browsery udelaji to, co si od toho slibujete, zatimco
> jine browsery (napr. starsi verse Mosaic) z toho zcela jiste
> 'zblbnou'.
>
> Zajimalo by me, kdyby nekdo vyloudil z nejakeho RFC, jak to vlastne
> alespon teoreticky ma fungovat.
>
> Asi pred mesicem jsem o tom psal do www-l (coz je adekvatnejsi
> konference) a ani tam nikdo nedokazal odpovedet.
>

Myslim, ze pro odpoved neni treba chodit nikam daleko:

RFC1866 - HTML 2.0, section 3.2.5. Comments

   To include comments in an HTML document, use a comment declaration. A
   comment declaration consists of `<!' followed by zero or more
   comments followed by `>'. Each comment starts with `--' and includes
   all text up to and including the next occurrence of `--'. In a
   comment declaration, white space is allowed after each comment, but
   not before the first comment.  The entire comment declaration is
   ignored.

      NOTE - Some historical HTML implementations incorrectly consider
      any `>' character to be the termination of a comment.


Cesky receno - komentar zacina <!, pokracuje dvojicemi -- text --
a konci >. O koncich radku se zde nehovori, nemaji z hlediska syntaxe
zadny specialni vyznam (uvnitr dvojice -- jsou znakem jako kazdy jiny,
mezi dvojicemi se chapou jako white space). legalni komentare tedy jsou:

<!>				(tenhle casto prohlizece nezvladaji)
<!-- komentar -->
<!-- komentar
-->
<!-- 1. komentar --		-- 2. komentar -->
<!-- 1. komentar --
  -- 2. komentar -->

Nespravny komentar je napriklad:

<! -- komentar -->	(mezi zacatkem a prvnim -- nesmi byt mezera)
<!-- komentar >         (schazi parove --)
<!-- 1.komentar -- 2. komentar -->	(schazi parove -- na zacatku 2. koment)

Co se tyce zobrazeni koncu radku, to je jina vec, ktera nema nic spolecneho
se syntaktickou analyzou dokumentu:

section 4.2.2. Conventional Representation of Newlines

...
   An HTML user agent should treat end of line in any of its variations
   as a word space in all contexts except preformatted text. Within
   preformatted text, an HTML user agent should treat any of the three
   common representations of end-of-line as starting a new line.

Z cehoz plyne, ze konec radku je s vyjimkou predformatovaneho textu
chapan jako mezera.

							Petr Lampa

--
Department of Computer Science and Engineering  E-mail: lampa at fee.vutbr.cz
Faculty of El. Engineering and Comp. Science	Phone: (+42 5) 7275/225,111
Technical University of Brno			Fax:  (+42 5) 41211141
Bozetechova 2, 612 66 Brno, Czech Republic



More information about the net mailing list