Contents

LinkAddition

The addition object for defining links in text components that don’t use HTML or Markdown formatting.

Declaration

object LinkAddition

Properties

NameTypeDescription
rangeLength Requiredinteger

The number of text characters to highlight as the link.

rangeStart Requiredinteger

The starting character index for the link addition. A range starts at 0 for the first character.

If you specify rangeStart, you must also specify rangeLength.

type Requiredstring

The type of addition. Use link.

URL RequiredSupportedURLs

The URL to open when a person 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
        }
      ]
    }
  ]
}

See Also

Links