[whatwg] Web Forms 2.0 comments - [ID] repetition index replacement

fantasai fantasai.lists at inkedblade.net
Tue Jun 15 02:33:45 PDT 2004


Ian Hickson wrote:
>
> Ouch, good point, a template might well include user-entered data that
> might match that string. For that matter a script might contain [foo]
> which happens to be the ID of the template.
> 
> I'm somewhat reluctant to just say "only do these attributes" since
> there's bound to be use cases where you need to do it that haven't been
> covered. Like, in fact, value (there are some interesting use cases that
> involve only using it in value, instead of name, and some cases where
> you would want to affect the scripts).
> 
> Any other ideas for solving this?

Change the replacement punctuation from "[id]" to "-.id.-" or ":-id-:" or
something like that. This has two advantages:

   a) The combination of that very unusual punctuation sequence (both
      opening and closing) /and/ an exact match of the template ID is
      going to be so rare as to be practically ignorable.
   b) ID and NAME attributes using the replacement mechanism can still
      be valid.

~fantasai

-- 
http://fantasai.inkedblade.net/contact




More information about the whatwg mailing list