Using tinymce in firefox, I just noticed if you add a preset rule to remove or change all table related tags then it affects the tinymce toolbar and breaks it.

Somehow the javascript function needs to be more selective in how it processes the cleaning.

Thanks

Ben

Comments

jide’s picture

Did you use multiple selectors, like "table, tr, td" ?
In this case, i know where the bug comes from, and it is not an easy one.
A simple solution right now is not to use multiple selectors and use several rules instead.

I ran into problems using contexts with complex jQuery selectors like "li[attr*=value]".

As a workaround, instead of doing :
$(rule, element)
We get the element through :
$(element.selector+' '+rule)
(That's in wysiwyg_cleaner.api.js, line 55)

That's quite an issue and has side effects, but I could not find another way to make those complex filters work. I spent hours trying to figure out why it does not work and could not find a clue, so my conclusion is that there is a bug in jQuery when combining complex filters, DOM manipulation and contexts.

The options we have are :
- Wait and see if future versions of jQuery are not affected with this bug anymore.
- Drop support for complex filters (that would be sad).
- Keep the workaround but enhance it to take care of multiple selectors.
- Try to fix the bug.

smoothify’s picture

Thanks for the quick reply and the suggestion

I was using multiple selectors - so switching to single ones does workaround the issue.

For me personally, the workaround is fine - and I do like the ability to have complex filters.

Ben

jide’s picture

Okay great. I leave the issue open since this really is the biggest issue with the module and I hope i will fix it some day.