Importing Entries from Craft 2 to Craft 3 with Feed Me - find/replace twig filter issues I'm migrating content from an old Craft 2 site (2.6.2985) to a new Craft 3 site. Cannot do a strait upgrade for various reasons.

I've started to set up an XML feed to use Feedme with. I am running into one issue where the body redactor field has a lot of images in it and I want do a find and replace to remove the absolute url and replace with a relative url so images will load on the front end.

My code:

&lt;root&gt;
{% for entry in craft.entries.section('articlesAndExcerpts').status('not foo').limit(1) %}
  &lt;entry&gt;

    &lt;title&gt;&lt;![CDATA[{{ entry.title }}]]&gt;&lt;/title&gt;

    {# more fields here #}

    &lt;body&gt;&lt;![CDATA[{{ entry.body|replace('src="https://memoirs.azrielifoundation.org/': 'src="/'}) }}]]&gt;&lt;/body&gt;

  &lt;/entry&gt;
{% endfor %}}
&lt;/root&gt;


With without the |replace('') filter everything is good. However when I use the replace filter it replaces the url as expected but at the same time creates a lot of html entities, like this:



How can I prevent this from happening and still do a find/replace on the image urls?
Also run the content through the |raw filter to get rid of the html entities. I believe that it works without the replace filter because once that is run, twig is parsing the provided text.