When ' or & are used in meta descriptions, they are converted into ' and & This HTML then displays in summaries in Google where they look bad. & and ' are both valid characters for meta descriptions, so Metatag should not convert them into HTML entities.

Sorry if this is a duplicate. I couldn't find another issue in the queue about this.

CommentFileSizeAuthor
#3 metatag-n2166109-3.patch4.38 KBDamienMcKenna
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Greg Boggs’s picture

Issue summary: View changes
DamienMcKenna’s picture

I've tracked the problem down to the theming functions, and ultimately theme_html_tag is to blame.

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
4.38 KB

Ok, this solves the problem, but it adds a requirement for all custom theming functions that they also fix the output (note added to README.txt about it).

Greg Boggs’s picture

Wow that was fast! I just explained that we should wait 3-4 weeks for a patch. I'll test this first thing in the morning. Thank you!

Greg Boggs’s picture

Well this is embarrassing. It appears I may have wasted your time with this report. It appears Meta descriptions are supposed to be HTML encoded now to be valid HTML.

Search Engines display them correctly as text in search results.

I didn't research this extremely well, but I did find this:
http://stackoverflow.com/questions/3311705/should-meta-tags-be-html-encoded

and
http://www.datadial.net/blog/index.php/2011/04/13/special-characters-in-...

DamienMcKenna’s picture

Status: Needs review » Closed (works as designed)

I thought so, but it was an excuse for me to dig into the codebase to remind myself how the output worked.