How to override markup in my .theme file?
I am afraid there is no way to fix this markup in theme file. In case you simply need to change spelling I suggest using string overrides as it is described in settings.php file.

$settings['locale_custom_strings_en'][''] = [ 
  'Search results' =&gt; 'New text',
];