• Formats value for target attribute of an anchor element, so that it can be edited as part of the CKEditor 5 Link feature (with additional CoreMedia Plugin).

    As CoreMedia Rich Text 1.0 does not support the target attribute, it was the best practice ever since CoreMedia Rich Text 1.0, to encode the target into two attributes xlink:show and xlink:role.

    For transformation, some artificial states provide a consistent format, so that it is suitable to restore the original state later on, when transforming target back to xlink:role/xlink:show again.

    Parameters

    • attributes: Pick<Partial<Record<string, string>>, "role" | "show">

      relevant XLink attributes role and show to format target.

    Returns string