Becky's got a point. Your plugin really should be excluding meta tags when it's doing it's processing. Those tags aren't relevant to your plugin's stated workflow after all.
Calibre/Kovid's reasons for what he does are immaterial to this issue. "name" is a valid attribute for meta tags, and "calibre:cover" violates no xhtml value character rules. Your plugin should not mangle them (or any existing meta tag)--especially since they're not in your plugin's bailiwick to begin with.
Your code is changing every "name" attribute it finds (in any tag) to an "id" attribute. That's just a bad idea.
Change:
Code:
#ensure all bookmarks have only 'id' attributes
for tag in soup.find_all(True):
if tag.has_attr('name'):
idref = tag['name']
del tag['name']
tag['id'] = idref
to:
Code:
#ensure all bookmarks have only 'id' attributes
for tag in soup.find_all(True):
if tag.has_attr('name') and tag.name != "meta":
idref = tag['name']
del tag['name']
tag['id'] = idref
and be done.
There's no reason for this plugin to be changing any meta tags.