Skip to content

Commit

Permalink
Fix retconOnly regression error. Bump to 2.7.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mmikkel committed Jul 23, 2023
1 parent f760321 commit 131548c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Retcon Changelog

## 2.7.0.1 - 2023-07-23
### Fixed
- Fixed a regression introduced in 2.7.0, that could remove text content from nodes returned by the `retconOnly` filter

## 2.7.0 - 2023-07-22
### Added
- Added a new `retconDimensions` filter, which can be used to set missing `width` and `height` attributes for image nodes.
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": "2.7.0",
"version": "2.7.0.1",
"keywords": [
"craft",
"cms",
Expand Down
2 changes: 1 addition & 1 deletion src/library/RetconDom.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function getHtml()
{
// Unwrap the <retcon> wrapper node
$rootNode = $this->doc->documentElement->firstChild;
if ($rootNode && $rootNode->parentNode) {
if ($rootNode && $rootNode->nodeName === 'retcon' && $rootNode->parentNode) {
$fragment = $this->doc->createDocumentFragment();
while ($rootNode->childNodes->length > 0) {
$fragment->appendChild($rootNode->childNodes->item(0));
Expand Down

0 comments on commit 131548c

Please sign in to comment.