[kupu-dev] Avoid filtering of specific attribute
Duncan Booth
duncan.booth at suttoncourtenay.org.uk
Mon Oct 1 14:59:14 CEST 2007
Max M <maxm at mxm.dk> wrote:
> Duncan Booth skrev:
>
>> includeTagAttributes('span', 'dynafield:view')
>>
>
>> But I'm not sure that will work or if the unexpected namespace might
>> caus
> e
>> problems.
>
> Turned out that I was close all the time:
>
> editor.xhtmlvalid.setTagAttributes(['div','span'],['dynafield:uid','dyn
> afield:view']); editor.xhtmlvalid.setAttrFilter(['dynafield:uid']);
> editor.xhtmlvalid.setAttrFilter(['dynafield:view']);
>
setTagAttributes overrides the permitted attributes for the tag: so you
have said that div and span can *only* have your custom attributes.
I think you really do need includeTagAttributes (although with the
parameters you used for setTagAttributes, not the ones I suggested).
> Det fik det til at køre. I missed the setAttrFilter at first. I
> thought that would make it actually do filtering on the attribute not
> allow it.
It does, it makes it filter the attribute instead of ignoring it. The
default filter function just copies the attribute.
More information about the kupu-dev
mailing list