Re: Bug: Option element containing illegal font eats whitespace

* Randy Waki wrote:
>If an option element contains an illegal font element followed by
>whitespace and some text, 08-Jul-2000 Tidy eats the whitespace, causing
>words to run into each other.

Same for August 2000 release.

>I'm temporarily working around this by
>having ParseText change the mode from IgnoreWhitespace to MixedContent
>when the illegal font is detected, but I'm not so sure that's the right
>fix.

Me neither.

>------------------------ Example HTML document -------------------------
><html>
><head>
>  <title></title>
></head>
><body>
>  <form method="get">
>    <select name="select">
>      <option value="1"> Tidy <font size="7"> gets </font> this right </option>
>      <!-- The following gets tidied into "Tidy getsthis wrong" -->
>      <option value="2"> Tidy <font size="7"> gets</font> this wrong </option>
>    </select>
>  </form>
></body>
></html>
>------------------------------------------------------------------------

Worse example (since font is treated special):

  <select>
  <option value="1"> Tidy <span> gets </span> this right </option>
  <option value="2"> Tidy <span> gets</span> this wrong </option>

gives us

  Tidy (vers 4th August 2000) Parsing "space-munge-in-select.t"
  line 1 column 1 - Warning: inserting missing 'title' element
  line 2 column 26 - Warning: discarding unexpected <span>
  line 2 column 32 - Warning: discarding unexpected plain text
  line 2 column 37 - Warning: discarding unexpected </span>
  line 2 column 45 - Warning: discarding unexpected plain text
  line 2 column 56 - Warning: discarding unexpected </option>
  line 3 column 26 - Warning: discarding unexpected <span>
  line 3 column 32 - Warning: discarding unexpected plain text
  line 3 column 36 - Warning: discarding unexpected </span>
  line 3 column 44 - Warning: discarding unexpected plain text
  line 3 column 55 - Warning: discarding unexpected </option>
  line 4 column 1 - Warning: missing </select>
  
  space-munge-in-select.t: Document content looks like HTML 3.2
  12 warnings/errors were found!
  
  <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
  <html>
  <head>
  <meta name="generator" content="HTML Tidy, see www.w3.org">
  <title></title>
  </head>
  <body>
  <select>
  <option value="1">Tidy</option>
  <option value="2">Tidy</option>
  </select>
  </body>
  </html>
-- 
Björn Höhrmann { mailto:bjoern@hoehrmann.de } http://www.bjoernsworld.de
am Badedeich 7 } Telefon: +49(0)4667/981028 { http://bjoern.hoehrmann.de
25899 Dagebüll { PGP Pub. KeyID: 0xA4357E78 } http://www.learn.to/quote/

Received on Friday, 25 May 2001 19:23:40 UTC