From 53b0604b031dec271a373e700386ebf010be3ead Mon Sep 17 00:00:00 2001 From: Daniel Riezebos Date: Tue, 11 Jan 2022 13:34:29 +0100 Subject: [PATCH 1/2] Resolved error-full merge conflict --- Plugin/Model/PagePlugin.php | 18 ------------------ Resolver/RemotePageResolver.php | 5 ++++- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/Plugin/Model/PagePlugin.php b/Plugin/Model/PagePlugin.php index 1dce364..0d8d551 100644 --- a/Plugin/Model/PagePlugin.php +++ b/Plugin/Model/PagePlugin.php @@ -6,7 +6,6 @@ use Magento\Cms\Model\Page; use Magento\Framework\Exception\LocalizedException; -use Mooore\WordpressIntegrationCms\Model\RemotePageRepository; use Mooore\WordpressIntegrationCms\Resolver\RemotePageResolver; class PagePlugin @@ -38,23 +37,6 @@ public function aroundGetContent(Page $subject, callable $proceed) return $proceed(); } - $html = $remotePage['content']['rendered']; - - $html = preg_replace_callback("{{{(.*)}}}", function ($matches) { - $match = $matches[0]; - - // Solve wierd encoding from Wordpress API regarding double-dashes - $match = preg_replace('/([^\s])–([^\s])/m', '$1--$2', $match); - - $match = html_entity_decode($match); - $match = str_replace('”', '"', $match); // Opening quote - $match = str_replace('″', '"', $match); // Ending quote - $match = str_replace('“', '``', $match); // Double quotes - return $match; - }, $html); - - $this->remotePageContentCache[$remotePageId] = $html; - return $html; } } diff --git a/Resolver/RemotePageResolver.php b/Resolver/RemotePageResolver.php index 96fa721..6f9b861 100644 --- a/Resolver/RemotePageResolver.php +++ b/Resolver/RemotePageResolver.php @@ -43,9 +43,12 @@ public function resolve(int $siteId, int $pageId): ?string /** @var string $html */ $html = $remotePage['content']['rendered']; - $html = preg_replace_callback("{{(.*)}}", function ($matches) { + $html = preg_replace_callback("{{{(.*)}}}", function ($matches) { $match = $matches[0]; + // Solve wierd encoding from Wordpress API regarding double-dashes + $match = preg_replace('/([^\s])–([^\s])/m', '$1--$2', $match); + $match = html_entity_decode($match); $match = str_replace('”', '"', $match); // Opening quote $match = str_replace('″', '"', $match); // Ending quote From 3ba8ed1128fc703fb68c5cb2ad1fe5e7bfe7d7c5 Mon Sep 17 00:00:00 2001 From: Daniel Riezebos Date: Tue, 11 Jan 2022 13:35:23 +0100 Subject: [PATCH 2/2] Changed changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eeed37e..ca40cd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.8.7] - 2022-01-11 +### Fixed +- Resolved wrongly fixed merge conflict + ## [0.8.6] - 2022-01-10 ### Fixed - Sometimes double-dashes gets encoded to one from API