Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html-minifier and valid content in <object> tags? #51

Closed
matt-bailey opened this issue Apr 18, 2013 · 3 comments
Closed

html-minifier and valid content in <object> tags? #51

matt-bailey opened this issue Apr 18, 2013 · 3 comments

Comments

@matt-bailey
Copy link

This is following on from my comment here: #45 (comment)

I've done a little more experimenting and discovered that certain html tags work inside <object> tags and others don't (they are moved to after the object tag).

For example, <img>, <span> and <i> all work ok, but <p> and <div> don't, i.e. inline level elements work, but not block level.

Having read up a little more on the <object> tag apparently you are allowed zero, or any number of <param> elements, plus 'transparent' content, i.e. content that is valid HTML5 even if these tags are removed.

I suspect therefore, that html-minifier is acting as intended and merely respecting valid html markup, but if you have any other insight into this I'd love to know :)

@jfaissolle
Copy link

I think this is because some tags are wrongly registered in htmlparser. I have the same problem with the <iframe> tag. This one as well as the <object> tag are registered as block level (correct) as well as inline elements (wrong). If you remove them from the inline list in htmlparser.js, it works fine.

@jfaissolle
Copy link

I just submitted a pull request: #52

@matt-bailey
Copy link
Author

Good stuff, well spotted.

@kangax kangax closed this as completed in b38600d May 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants