Re: Tidying the value of an attribute?

On Thu, 3 Aug 2000, Rzepa, Henry wrote:

> Example 1 Fails with Tidy with the error "Error: missing
> quotemark for attribute value"
> Example 2 Works as Richard Indicates
> 
> Example 1
> 
> <EMBED SRC="caffeine.pdb" name="caffeine" bgcolor=#D28543
> align=abscenter width=250 height=300 spiny=360
> startspin=true display3D=ball&stick SCRIPT="
> # Avoid Colour Problems!
> select (atomno>=15) and (atomno<=24)
> select atomno=(atomno>=1) and (atomno<=14)
> select (atomno>=16) and (atomno<=23)
> ">
> 
> Example 2
> 
> <EMBED SRC="caffeine.pdb" name="caffeine" bgcolor=#D28543
> align=abscenter width=250 height=300 spiny=360 startspin=true
> display3D=ball&stick SCRIPT="
> # Avoid Colour Problems!
> select (atomno>=15) and (atomno<=24)
> select (atomno>=16) and (atomno<=23)
> ">

Tidy has to use a rule of thumb to detect missing trailing
quote marks and missing close tag symbols (">"). This works
by giving bad marks to a number of features and reaching a
conclusion once the aggregate score exceeds some limit.

It is no good tweaking these rules which are there for the
common case. Instead, it will be necessary to switch
off the quotemark rule and preserve the line breaks as per
the authors original intentions.

It is a shame that the plugin relies in the line breaks
as this prevents this markup from being reflowed. For
JavaScript literals, Tidy know's how to escape any newlines
it inserts so that these don't effect the script. What you
have is the reverse - the line breaks are significant and
need to be preserved.

I will look into this.

Perhaps the solution is to add a new config option to 
declare particular attributes as behaving like PRE content. 

Regards,

-- Dave Raggett <dsr@w3.org> http://www.w3.org/People/Raggett
tel/fax: +44 122 578 3011 (or 2521) +44 778 532 0444 (mobile)
World Wide Web Consortium (on assignment from HP Labs)

Received on Thursday, 3 August 2000 07:04:08 UTC