[Zope-dev] chameleon.core removes the meta http-equiv="content-type" tag

Dan Korostelev nadako at gmail.com
Fri Aug 14 09:07:46 EDT 2009


Oh, thanks that you reminded me of that :))

This looks like it migrated from zope.pagetemplate. That shameless
removal of content from my template annoyed me as well some time ago,
so at last I monkey-patched that method in zope.pagetemplate. I think,
we should remove that behaviour from both zope.pagetemplate and
chameleon.core, because it's developer' prerogative to decide what to
keep and what to remove from the rendered page, not the templating
system's. If noone objects, I'll fix it in zope.pagetemplate.

2009/8/14 Fabio Tranchitella <kobold at kobold.it>:
> I hope this is the right mailing list for such a question. Why does
> chameleon.core removes the meta tag http-equiv="content-type" from the
> output?
>
> In template.py, line 286:
>
>    # Look for an encoding specification in the meta tag
>    match = utils.re_meta.search(body)
>    if match is not None:
>        content_type, encoding = match.groups()
>        # TODO: Shouldn't <meta>/<?xml?> stripping
>        # be in PageTemplate.__call__()?
>        body = utils.re_meta.sub("", body)
>    else:
>        content_type = None
>        encoding = config.DEFAULT_ENCODING
>
> I couldn't find the explanation anywhere in the source code nor in the
> documentation.

-- 
WBR, Dan Korostelev


More information about the Zope-Dev mailing list