Ensure that URLs are assigned to correct anchor tags in translatable strings
We're assigning URLs at runtime while resolving translations. Currently, we're doing that by assigning them in the order of the anchor tags we find inside the string. However, that order may change depending on how the string got translated. Therefore we need to be able to uniquely mark up parts of translatable strings so that we're not only able to tell that they're supposed to be hyperlinked but also which link they refer to.
This is essential for the upcoming first-run page which, unlike other pages, has strings which contain multiple strings in the same sentence (see eyeo/specs/spec!148 (merged)).
Note that we probably don't want to change all translatable strings, we should prefer a backwards compatible approach.
What to change
- Introduce support for the tags
<a9>in translatable strings.
- Handle legacy
<a>tags in the order they appear in (i.e. use current behavior) but after handling all
- Prevent using the same
<a#>tag multiple times in the same string.
- Prevent using
<a>tags in strings that contain