Skip to content
Snippets Groups Projects

Issue #3413647: Fix HTML tags getting double-encoded in data-caption

Open Oden requested to merge issue/entity_embed-3413647:3413647-html-tags-showing into 8.x-1.x
1 file
+ 0
13
Compare changes
  • Side-by-side
  • Inline
@@ -537,7 +537,6 @@ class EntityEmbedDialog extends FormBase {
@@ -537,7 +537,6 @@ class EntityEmbedDialog extends FormBase {
'#type' => 'textarea',
'#type' => 'textarea',
'#rows' => 3,
'#rows' => 3,
'#default_value' => isset($entity_element['data-caption']) ? Html::decodeEntities($entity_element['data-caption']) : '',
'#default_value' => isset($entity_element['data-caption']) ? Html::decodeEntities($entity_element['data-caption']) : '',
'#element_validate' => ['::escapeValue'],
];
];
}
}
@@ -850,18 +849,6 @@ class EntityEmbedDialog extends FormBase {
@@ -850,18 +849,6 @@ class EntityEmbedDialog extends FormBase {
return $response;
return $response;
}
}
/**
* Form element validation handler; Escapes the value an element.
*
* This should be used for any element in the embed form which may contain
* HTML that should be serialized as an attribute element on the embed.
*/
public static function escapeValue($element, FormStateInterface $form_state) {
if ($value = trim($element['#value'])) {
$form_state->setValueForElement($element, Html::escape($value));
}
}
/**
/**
* Returns the allowed display plugins given an embed button and an entity.
* Returns the allowed display plugins given an embed button and an entity.
*
*
Loading