Cześć Michał!
The recommended way to achieve this is to define a custom link class with the styling you need and then simply use a JSON string as the value for the name attribute. You can then get whatever information you need from this JSON string in your event handler.
For example, set your text strings like this:
<a name="{\"id\":1}" class="tag1">ABC</a>
<a name="{\"name\":\"asd\", \"width\":120}" class="tag2">CBA</a>
And then in your event handler something like this
public void OnClick(HyperText sender, HyperText.LinkInfo link)
{
MyClass myObject = JsonUtility.FromJson<MyClass>(link.Name);
}