« Return to Thread: [tools] Generating XHTML-compliant Javascript with ValidatorTool

Re: [tools] Generating XHTML-compliant Javascript with ValidatorTool

by Nathan Bubna :: Rate this Message:

| View in Thread

I trust your judgment. :)

On Tue, Mar 6, 2012 at 6:59 AM, Christopher Schultz
<chris@...> wrote:

> Nathan,
>
> On 3/6/12 9:46 AM, Nathan Bubna wrote:
>> Not to pick at semantics, but the xhtml feature came after the
>> ValidatorTool, so i'd call it an oversight that the ValidatorTool was
>> not changed to respect it.
>
> Okay, not a problem... I can fix it :)
>
> What do you think the best fix would be?
>
> It might be nice to (continue to) have CDATA optional. In that case, &&
> would need to be escaped (along with other stuff, of course). I think we
> only need to escape & < and >. Quotes and apostrophes aren't relevant,
> here, because everything is in a <script> tag so we won't have to worry
> about attributes, etc.
>
> The other option would be to make CDATA mandatory when in XHTML mode.
> That would probably break templates that have already been written to
> handle this situation. I think the above is a better idea.
>
> So, I can add logic something like this:
>
>   if(xhtml & !cdata)
>     js = escape(js);
>
> I think that will solve the problem without stepping on anyone's toes.
>
> Any comments?
>
> -chris
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...

 « Return to Thread: [tools] Generating XHTML-compliant Javascript with ValidatorTool