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

suresh kumara created an issue. See original summary.

FlutterStack’s picture

Issue summary: View changes
FlutterStack’s picture

Issue summary: View changes
FlutterStack’s picture

Issue summary: View changes
DamienMcKenna’s picture

Issue summary: View changes
DamienMcKenna’s picture

Issue summary: View changes
DamienMcKenna’s picture

I adjusted the summary to use correct syntax so the code would be visible, please let me know if it is still correct.