From doing some experimentation, the only way I've been able to find to get the string
property out of an instance of Drupal\Core\Render\Markup
is to use the __toString()
method:
$variables['fields']['title']->content->__toString();
But I'm guessing those initial underscores indicate that this is a private function, not to be used on the outside. Is there some better method to get at the content? My ultimate goal is modifying that content in some way.