SchemaMetatagManager::encodeJsonld uses json_encode() with a number of options that garble any HTML contained in $items. This is problematic in the case of job postings because Google requires the 'description' property to be valid HTML: https://developers.google.com/search/docs/data-types/job-posting#JobPost....
Specifically, the json_encode() options are as follows:
Remove the options in question:
public static function encodeJsonld(array $items) {
// If some group has been found, render the JSON LD,
// otherwise return nothing.
if (!empty($items)) {
- return json_encode($items, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE);
+ return json_encode($items, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
}
else {
return '';
}
}
Community/maintainer feedback.
None.
None.
None.
Needs review
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.