Closed rnixx closed 10 years ago
if you take a closer look how the serializer is created, you'll recognize that there is no difference except the tree is not parsed by lxml's HTMLParser
https://github.com/repoze/repoze.xmliter/blob/master/repoze/xmliter/utils.py#L19
https://github.com/plone/plone.app.blocks/blob/rnixx-issue5/plone/app/blocks/transform.py#L84
the serializer object is now created "by hand"
Ah yes, right, this still might break diazo.
Looking at https://github.com/repoze/repoze.xmliter/blob/master/repoze/xmliter/utils.py#L11 it seems that is the response is already parsed, it'll re-use it. This might screw up diazo's doctype override capability.
It might be worth testing diazo is all I'm saying..
"Could not find .travis.yml, using standard configuration"?
Isnt the policy to check plone.* code at http://jenkins.plone.org/ ? But here we have Travis?
And if theres a travis run configured, why is the configuration not set?
Questions....
ok, well, might be that result is already a XMLSerializer, might be checked prior to creating a new one
So if that XMLSerializer was created the normal way, it'd still break anyways right?
Still, this might break plone.app.theming since the transform is run later.
I think we might have to tackle this issue from another angle.
i think p.a.theming and p.a.blocks should use the same parsed tree, even the technique used, but should not imply that each result is a full blown html document. thus there should be a utility function similar to the one in repoze.xmliter doing the described stuff and then also be used in theming (if thet is possible without tons of hassle).
anyway, if diazo is installed and we want to skip, diazo rendering x-theme-disabled header is set. similar could be done for blocks, but what if i want to integrate the tiles rendering transformation for HTML snippets this issue is all about?
whats the state of this one?
imo there's still the need of avoiding the expectation of complete HTML documents for the transforms. my solution at the time of writing was to simply not use p.a.blocks / c.cover
I close this pull, because this is not solution to the issue. I add a one more comment to the issue about the solutions.
I thought part of the reason this serializer was used was so that diazo could re-use this parsing.
If this change causes plone.app.theming to parse the dom an additional time, I'm against this change.
This also plays into the serializer used in plone 5 to facilitate auto csrf protection.