[kupu-dev] Avoid filtering of specific attribute

Max M maxm at mxm.dk
Fri Oct 5 11:11:24 CEST 2007


Duncan Booth skrev:
> Max M <maxm at mxm.dk> wrote:
> 
>> includeTagAttributes will not work, as span and div does not have any 
>> attributes set to begin with.
>>
> 
> That's news to me. They should have a load of attributes set to begin with: 
> kupucontentfilters sets them both up with attributes id, title, style, 
> class, lang, dir, xml:lang, plus align for div but not span.

Ok. That makes sense.

But if I try to write

      validator.includeTagAttributes(['span'],allowedAttrs);

Instead of

      validator.setTagAttributes(['span'],allowedAttrs);

I get the error

     this.tagAttributes[tag] has no properties

And this happens in kupucontentfilters.js::

     // define some new attributes for existing tags
     this.includeTagAttributes = function(tags, attributes) {
         for (var j = 0; j < tags.length; j++) {
             var tag = tags[j];
             this.tagAttributes[tag] = 
this.tagAttributes[tag].concat(attributes);
         }
     }

So at least when I am trying to call it in kupuploneinit.js in function 
initPloneKupu(), it is not possible to use includeTagAttributes. 
Seemably because it has no prior attributes set.

-- 

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science



More information about the kupu-dev mailing list