diff --git a/CHANGELOG.md b/CHANGELOG.md index 27fb329..fa94915 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## 3.1.1 - 2024-06-14 +### Fixed +- Fixes a compatibility issue with CKEditor 4.1, where applying a Retcon filter to a CKEditor field's output would cause nested entries to not render + ## 3.1.0 - 2024-06-10 ### Added - Adds support for the body element selector (i.e. `'body'`), which can be used in conjunction with the child combinator to only select top-level nodes (e.g. `'body > p'`). [#68](https://github.com/mmikkel/Retcon-Craft/issues/68) diff --git a/composer.json b/composer.json index c8d78ca..05d25b9 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "mmikkel/retcon", "description": "Powerful Twig filters for mutating and querying HTML", "type": "craft-plugin", - "version": "3.1.0", + "version": "3.1.1", "keywords": [ "craft", "cms", diff --git a/src/helpers/RetconHelper.php b/src/helpers/RetconHelper.php index d786421..46de641 100644 --- a/src/helpers/RetconHelper.php +++ b/src/helpers/RetconHelper.php @@ -4,6 +4,7 @@ use aelvan\imager\Imager; +use craft\ckeditor\data\FieldData; use spacecatninja\imagerx\ImagerX; use mmikkel\retcon\models\RetconSettings; @@ -44,12 +45,14 @@ class RetconHelper * @param mixed $value * @return null|string */ - public static function getHtmlFromParam($value): ?string + public static function getHtmlFromParam(mixed $value): ?string { if (empty($value)) { return null; } - if ($value instanceof HtmlFieldData) { + if ($value instanceof FieldData) { + $html = $value->__toString(); + } elseif ($value instanceof HtmlFieldData) { $html = $value->getRawContent(); } else { $html = (string)$value;