The addition object for defining links in text components that don’t use HTML or Markdown formatting.
Technology
- Apple News Format 1.11.0+
Properties
range Length
integer
The number of text characters to highlight as the link.
range Start
integer
The starting character index for which the link addition is meant. A range starts at 0
for the first character.
If range
is specified, range
is required.
type
string
The type of addition. Use link
.
The URL to open when a user interacts with the range of text specified in the addition.
Discussion
Use a Link
addition to add a link in a text component. You can link to an anchor in the same document, to another document in News, or to an external site.
Example
{
"components": [
{
"role": "body",
"text": "This is an example of a link addition",
"additions": [
{
"type": "link",
"URL": "http://www.apple.com",
"rangeStart": 0,
"rangeLength": 20
}
]
}
]
}