Http-equiv meta tag


where the <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> came from in the Plone pages? We would like to drop it and use <meta charset="utf-8" />.

That's interesting, the meta header in main_template was already changed in 2017, but that was on master:

Plone 5.2.x branch still has the content attribute as well:

If you render a page in Plone 6, you will see the http-equiv meta tag. It is not in the main_template, I suppose.

This is coming from the theme: plonetheme.barceloneta/index.html at a0df3545a5d6c2dd0198fe30ceea96e9eddf5db9 · plone/plonetheme.barceloneta · GitHub

It was changed 3 months ago.

If you try to remove it or do a custom theme, it is still there.

The page above is a demo, the real index is this: and I'm running it. If you render the page, http-equiv get in. Maybe it came from Zope 5.3.0?

It is really strange, if you grep 'http-equiv' it is read and used in just one zmi template and something else in read, but nowhere else. It does not appear anywhere in Plone.

I've found this:

tostring(doc, pretty_print=False, include_meta_content_type=False, encoding=None, method=' html ', with_tail=True, doctype=None) source code

Return an HTML string representation of the document.

Note: if include_meta_content_type is true this will create a <meta http-equiv="Content-Type" ...> tag in the head; regardless of the value of include_meta_content_type any existing <meta http-equiv="Content-Type" ...> tag will be removed

but the default seems False. But maybe worth a check?

but the default seems False. But maybe worth a check?

Sigh. That could very well be true and valuable to check. I thought quickly about Diazo when replying but left it out in my first respone.

I had an issue years ago where <!DOCTYPE html> appeared twice in the html or conflicted with the html4/xhtml version, which was also added by lxml.

[edit: fix escaping of html in the text]

1 Like

@yurj pointed me here, as I wrote an issue as it seems doctype and namespace don't match...

1 Like

ok little digging: HTML html xmlns Attribute

"The xmlns attribute is required in XHTML, invalid in HTML 4.01, and optional in HTML5."
"This is because the namespace "xmlns=" is default, and will be added to the <html> tag even if you do not include it."

so its ok to have it there even in html5 - I'll close my ticket :wink:

1 Like