Hi! Sorry for my English(
I use the Metatag module on this site http://aa-lol.ru/63
In open graph meta tag ("description") html tags doesn't encoding like this:
<meta property="og:description" content="<strong>“</strong>;Three Centuries on the Hudson River<strong>”</strong>; is a book about Hoogebergh, a 1696 family homestead in upstate New York, and the eleven generations of the Staats family who have live >strong> >/strong>there.
Th" />
When I share posts in facebook, it merges into a single line(
How can I enable encoding HTML chars?
Please, help!
Comments
Comment #1
ArtoRovie commentedComment #2
ArtoRovie commentedComment #3
ArtoRovie commentedComment #4
damienmckennaI think this is because strip_tags() is ran on the values, and then they're ran through check_plain() again before they're finally output.
Comment #5
damienmckennaDoes this resolve the problem?
Comment #6
damienmckennaComment #7
damienmckennaComment #8
damienmckennaComment #9
markdorisonI am still encountering this issue even with the patch in #5 applied. Example output:
<meta name="description" content="This rich yet simple chocolate cake gets a little kick from a touch of smoked Spanish paprika and espelette. Espelette is a smoky chile powder from France.">Comment #10
damienmckenna@markdorison: If you see "
" in a field it comes from the source field's data. That said, because it's a known problem we can fix it.Comment #11
markdorison@DamienMcKenna: I applied the patch in #10 and I was still seeing the issue. When I var_dump() $value before your changes, I am not seeing   but instead the a-circumflex character:
"This rich yet simple chocolate cake gets a little kick from a touch of smoked Spanish paprika and espelette. Espelette is a smoky chile powder from France."Some searching (https://www.google.com/search?q=nbsp+a-circumflex&oq=nbsp+a-circumflex) describes this as a character encoding issue. It seems to be converting successfully back to   by the time it makes it to the browser, but at the point you are trying to replace  , there isn't one there to replace.
Comment #12
damienmckennaThere's a very fine line between correcting encoding errors and screwing up a non-English site. That's one reason that delving further into this makes me nervous. Out of interest, for the node with the a-circumflex problem, do you also see that character in the node display itself?
Comment #13
markdorison@DamienMcKenna: By the time the text makes it into markup it seems to have reverted back to the expected  . The only place I have seen the a-circumflex is when I var_dump() the value in tidyValue().
Comment #14
damienmckennaHow does this work?
Comment #15
markdorison@DamienMcKenna #14 works for me.
Comment #16
damienmckenna@markdorison: Thanks for letting me know.
I've committed this.
Comment #18
markdorison@DamnienMcKenna: Absolutely; thank you for the fix!
Comment #19
dave reidI'm confused. Why wouldn't decode_entities() call itself convert ' ' to a space? That's what it's designed to do.
Comment #20
damienmckennaThis difference is why.