How to disable htmlspecialchars in custom module form table? I'm making a table form

$form['table'] = [
  '#type' =&gt; 'tableselect',
  '#header' =&gt; $header,
  '#options' =&gt; $this-&gt;getOutput(),
  '#empty' =&gt; t('No vehicles found'),
];


In getOutput() I have 'vehicleName' =&gt;  "&lt;a href=\"/vehicle?id=" . $vehicle-&gt;vehicleId . "\"&gt;"  . $vehicle-&gt;vehicleName . "&lt;/a&gt;", for one of the fields. And it doesn't print out as normal html. It goes through htmlspecialchars() and I don't have clickable link at the end. How can I disable this?
You can use FormattableMarkup

Here's a simple example to get you started

use Drupal\Component\Render\FormattableMarkup; // place this at top of file

$options = [
  1 =&gt; ['foo' =&gt; 'Foo'],
  2 =&gt; ['foo' =&gt; 'Bar'],
  3 =&gt; ['foo' =&gt; new FormattableMarkup('&lt;a href="http://example.com"&gt;I am a link&lt;/a&gt;', [])],
];

$header = [
  'foo' =&gt; t('Foo bar')
];

$form['table'] = [
  '#type' =&gt; 'tableselect',
  '#title' =&gt; t('Foo bar table'),
  '#header' =&gt; $header,
  '#options' =&gt; $options,
  '#empty' =&gt; t('No foos found.'),
];


So in your case $this-&gt;getOutput() may return something like (this is untested):

['vehicleName' =&gt;  new FormattableMarkup(
  '&lt;a href="/vehicle?id=@id"&gt;@name&lt;/a&gt;', 
  ['@id' =&gt; $vehicle-&gt;vehicleId, '@name' =&gt; $vehicle-&gt;vehicleName]
)]