Skip to content

Commit

Permalink
Fix compatibility issue with CKEditor 4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mmikkel committed Jun 14, 2024
1 parent 43fc2d8 commit 17a58ef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 5 additions & 2 deletions src/helpers/RetconHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use aelvan\imager\Imager;

use craft\ckeditor\data\FieldData;
use spacecatninja\imagerx\ImagerX;

use mmikkel\retcon\models\RetconSettings;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 17a58ef

Please sign in to comment.