Problem/Motivation

Say I want to do something like this:

t('<span class="@class" title="Translatable title"></span>')

So I read the FormattableMarkup::placeholderFormat() doc to choose the correct placeholder type:
The doc says I should not use @ or % in attribute values.
It also says that : is only for href attributes.

So I'm left with no recommended solution.
Should I give up on having a dynamic value for this attribute? Should I try to escape it myself?
IMHO this is bad DX and could lead to some developpers not escaping attributes correctly.

Steps to reproduce

Proposed resolution

Document the correct solution for this use case.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Comments

prudloff created an issue.