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

Consider PHP HTML5 parser? #9

Open
watou opened this issue Dec 7, 2013 · 1 comment
Open

Consider PHP HTML5 parser? #9

watou opened this issue Dec 7, 2013 · 1 comment

Comments

@watou
Copy link

watou commented Dec 7, 2013

Enhancement suggestion: Would it be too heavy to include https://github.com/Masterminds/html5-php or another HTML5 parser in order to avoid the deficiencies that arise from XML parsing the input? Perhaps giving the user the option of using the HTML5 parser instead of PHP's DOM extension?

@oo12
Copy link
Collaborator

oo12 commented Dec 10, 2013

Hmm, maybe at some point. It would certainly be nice if something like this got built in to PHP, but at the rate people upgrade... :-/
I looked into this briefly earlier this year but it seems a bit overkill for a single snippet, and I imagine libxml is considerably faster since it's compiled C vs. interpreted PHP. Plus, it handles most HTML5 stuff ok.

I'm curious though, what kind of content are you feeding it and what's generating this content? The version of TinyMCE in the MODX package is a bit old and doesn't really support HTML5. CKEditor is likely about the same. Redactor probably is better for HTML5 support, though I don't know by how much.

As I see it, imageSlim's main purpose is to offer some general level of control over images in a "blob" of rich text (probably one created not by a developer). If you happen to have full control over the input—it's a chunk, say, that you typed in yourself—then it'd be more efficient and give a higher level of control to use pThumb directly to resize any images.
Though there could be some other use cases I haven't thought much about, like dealing with markup coming from somewhere else, an existing database or another site...

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