Validation messages are not htmlable, but they output htmlable label values by default

When I create a TextInput field, I can make the label htmlable:
TextInput::make('column')
  ->label(fn() => new HtmlString('<span>Some text</span>'))
  ->required()

This is fine, however validation messages are currently not htmlable, and this leads to an undesired bug in the output of validation messages, see image.

Is there a way to solve this?

Right now it seems the only solution to this it to completely customise the validation messages, but this is unfeasible. Ideally, the validation message might either take the rendered label html, or would be htmlable too.

Or is there some other way around this?
image.png
Solution
I just discovered ->validationAttribute(), which solves this by allowing you to independently define the attribute used in validation messages!!!
Was this page helpful?