With SWF Tools 6 you can get compliant code if you use SWF Object 2 or direct embedding

In this module's handbook page is stated than not compliant code might get generated in many situations.
It seems to me that those situations should be some how manageable. The consideration of being enclosed between a <p> tag is just to narrow and the handbook recognizes that many inline cases would not be compliant code.

Isn't this issue aimed?

Comments

arhak’s picture

Beyond not generating compliant code this module won't give other filter a chance to do it, since the handbook page list as a requirement this filter to be last one or at least not followed by any other filter which might try to fix the compliant code issue:

The SWF Tools filter will need to come after any HTML corrector modules

Stuart Greenfield’s picture

Beyond not generating compliant code this module won't give other filter a chance to do it

That's not strictly true. If you wanted you could put the SWF Tools filter at the top of the filter list, but you'd need to add any tags to the subsequent filters so they aren't stripped out. By putting the filter at the bottom it makes the module easier to use in most cases and it means much less user configuration is needed.

In terms of compliant code, the <p> tag case is by far and away the most common cause of non-compliant code so that's why that one is specifically addressed. The issue (for JavaScript replacement) is that the flash content needs to sit inside a div, so the script method can replace the whole div with the flash content. The problem is when you try to make the flash render 'in-line'. In that case you have no choice but to put a div inside a p, and then you don't have compliant code.

The fix would be to search around the replacement code area, find the p tags, and then replace everything, but then we'd need to work out what other content needs to be "saved" and add that back in! In most cases the flash content doesn't appear in line, so that's why compliant code isn't available in every case at the moment.

No-one has ever come back and explicitly said that they need compliant in-line code, so I've not gone back and revisited yet...

arhak’s picture

Priority: Normal » Minor

I agree no one will die for it (changing it to minor)

I didn't get what you mean with

but you'd need to add any tags to the subsequent filters so they aren't stripped out

PS: I hope you won't mind leaving this issue opening just for tracking

Stuart Greenfield’s picture

No problem leaving it open - I might try and work on this at some point in the future.

What I mean by adding tags is that if you put the SWF Tools filter near the start it will replace the <swf> tags with the markup that produces flash content. If you then ran the HTML filter you would need to make sure that it was set to allow <script>, <object> or <embed> tags through. But that means you let those tags through on all content using that filter, so you might open up vulnerabilities in your site.

By running SWF Tools near the end of your filters you make sure the necessary tags don't get stripped out.

arhak’s picture

Status: Active » Postponed

yes, I was aware of that
thanks for your patient
BTW, your explanations in this issue seems clear enough to deserve being included in the documentation (at least as a referenced url)