diff --git a/CHANGELOG.md b/CHANGELOG.md index d458bde..1baaa8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Typogrify Changelog +## 1.1.22 - 2024.03.27 +### Fixed +* Fixed a regression that happened when modernizing the `default_escape` functionality ([#86](https://github.com/nystudio107/craft-typogrify/issues/86)) + ## 1.1.21 - 2024.03.27 ### Added * Add `phpstan` and `ecs` code linting diff --git a/composer.json b/composer.json index 968ec97..93435e0 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "nystudio107/craft-typogrify", "description": "Typogrify prettifies your web typography by preventing ugly quotes and 'widows' and more", "type": "craft-plugin", - "version": "1.1.21", + "version": "1.1.22", "keywords": [ "craft", "cms", diff --git a/src/variables/TypogrifyVariable.php b/src/variables/TypogrifyVariable.php index 97f43c2..4d646ca 100755 --- a/src/variables/TypogrifyVariable.php +++ b/src/variables/TypogrifyVariable.php @@ -309,8 +309,10 @@ private function normalizeText($text): string if ($settings['default_escape'] === true) { $twig = Craft::$app->getView()->getTwig(); - $twig_escape_filter = $twig->getFilter('twig_escape_filter'); - $text = $twig_escape_filter->getCallable()($twig, $text); + $twig_escape_filter = $twig->getFilter('e'); + if ($twig_escape_filter) { + $text = $twig_escape_filter->getCallable()($twig, $text); + } } return $text;