Meta tag can also have <anystring>
format. Currently if we add title as <anystring>
then metatitle is empty.
In modules/contrib/metatag/src/MetatagManager.php:463: $processed_value = PlainTextOutput::renderFromHtml(htmlspecialchars_decode($this->tokenService->replace($tag->value(), $token_replacements, ['langcode' => $langcode])));
htmlspecialchars_decode function is converting html elements. Suppose in metatitle string contains <p>test
since <p>
is a valid html element htmlspecialchars_decode function renders <p>test</p>
.
Suppose in metatitle string contains <anystring>test
since <anystring>
is not a valid html element htmlspecialchars_decode function renders empty.
Comments
Comment #2
FlutterStack CreditAttribution: FlutterStack commentedComment #3
FlutterStack CreditAttribution: FlutterStack commentedComment #4
FlutterStack CreditAttribution: FlutterStack commentedComment #5
DamienMcKennaComment #6
DamienMcKennaComment #7
DamienMcKennaI adjusted the summary to use correct syntax so the code would be visible, please let me know if it is still correct.