Underscore is added to links in view I'm writing a workaround to fix the breaking changes introduced to our XML feed when we updated from Drupal 8.4 to 8.5. Since PATH is no longer available but has been replaced with LINK, I've had to craft the Rewrite Results to be /news/{{ view_node }}, which displays a properly formatted URL in the preview:

&lt;link&gt;http://sitename.com/news/article-title&lt;/link&gt;


However, in the actual XML feed, it comes out like this:

&lt;link&gt;http://sitename.com/news/article-title_&lt;/link&gt;


arbitrarily adding an underscore and breaking the URL. Is there a way to make this not happen?
After much work I came up with a workaround. My first thought was to add a Twig filter to views-view-row-rss.html.twig like so &lt;link&gt;{{ link | replace('_', '') }}&lt;/link&gt; but the underscore was still being displayed, which told me that either 1. the Twig filter wasn't working or 2. the underscore was being applied later in the render process.

The Twig template's documenation made reference to a template_preprocess_views_view_row_rss() hook I found implemented in /core/modules/views/views.theme.inc so I added the following hook to my custom.theme PHP file:

function ncei_preprocess_views_view_row_rss(&amp;$variables) {
  $item = $variables['row'];
   $variables['title'] = $item-&gt;title;

   //$variables['link'] = $item-&gt;link;
   $variables['link'] = str_replace("_", "", $item-&gt;link);

   if (isset($item-&gt;description) &amp;&amp; is_array($item-&gt;description)) {
     $variables['description'] = (string) \Drupal::service('renderer')-            
       &gt;render($item-&gt;description);
   }

 $variables['item_elements'] = [];
 foreach ($item-&gt;elements as $element) {
   if (isset($element['attributes']) &amp;&amp; is_array($element['attributes'])) {
     $element['attributes'] = new Attribute($element['attributes']);
   }
   $variables['item_elements'][] = $element;
 }
}    


I commented out the original line above for reference, but I'm setting the link variable to the item's link, stripped of all undertscores. This isn't the best solution, and will break if the link actually contains underscores, but it worked as a temporary workaround in the meantime.