Skip to content
Snippets Groups Projects

fix - Custom caption with tokens doesn't render HTML characters

1 file
+ 2
1
Compare changes
  • Side-by-side
  • Inline
+ 2
1
@@ -10,6 +10,7 @@ use Drupal\Component\Utility\Xss;
use Drupal\file\Entity\File;
use Drupal\image\Entity\ImageStyle;
use Drupal\responsive_image\Entity\ResponsiveImageStyle;
use Drupal\Component\Utility\Html;
/**
* Prepares variables for colorbox formatter templates.
@@ -429,5 +430,5 @@ function _colorbox_formatter_get_caption(&$variables) {
if (((strpos($colorbox_style, 'colorbox/example') !== FALSE) || $config->get('colorbox_caption_trim')) && (strlen($caption) > $trim_length)) {
$caption = substr($caption, 0, $trim_length - 5) . '...';
}
return Xss::filter($caption);
return Html::decodeEntities(Xss::filter($caption));
}
Loading