Unable to change #markup I'm using Drupal 8, and I want to change the markup of more_links from &lt;a href=&quot;/node&quot;&gt;more&lt;/a&gt; to something like &lt;a class=&quot;some class&quot; href=&quot;/node&quot;&gt;more&lt;/a&gt;. I have tried with mytheme_preprocess_container(&amp;$vars) with the help of kint debug to analysis the $vars array. $vars['element']['#markup'] returns &lt;a href=&quot;/node&quot;&gt;more&lt;/a&gt;. However, setting it to a value does not applied.
function saidbakr_preprocess_container(&amp;$vars){
 $vars['element']['#markup'] = 'HHHHHHHH';
} 

I tried to use the #children but it has a protected property of markup and I don't know to how use the create method?
$vars['element']['#children']-&gt;create('HHHHH')

What's the problem here?

Update:
I just have gotten a semi solution, I regard it semi because it depends on a direct echo from template_preprocess_container like the follwoing:
function saidbakr_preprocess_container(&amp;$vars){
  $elem = $vars['element'];  
  if ($elem['#type'] == 'more_link'){
    $vars['children'] ='';
    echo str_replace('&lt;a','&lt;a class=&quot;btn btn-primary&quot; ', $vars['element']['#children']);
  }
}

I used echo because setting HTML tags string to $vars['children'] leads them to be printed as entities on the page. i.e you see the HTML tag of the link instead of the actual link. Is there any concerns about using direct echo from the preprocess functions?
You should be able to change the more variable in template_preprocess_views_view, like:

function YOUR_THEME_preprocess_views_view(&amp;$variables) {
  $variables['more'] = \Drupal\Core\Render\Markup::create('&lt;a href="#"&gt;HHH&lt;/a&gt;');
}