nascentdigital / contentfully

A simple but performant REST client for Contentful.
MIT License
18 stars 7 forks source link

Missing de-referenced links in RichText type field #27

Closed angelalagao closed 4 years ago

angelalagao commented 4 years ago

Currently, entry references within rich text fields are not de-referenced in Contentfully.

Rich Text fields are useful for text formatting with references and media, in which there are two ways references are embedded within rich text:

  1. Entry (embedded-entry-block)
  2. Inline entry (embedded-entry-inline)

Suggestion: Let's include Rich Text embedded entries as links when parsing and update these to have de-referenced values.

Sample data:

{
  "richText": {
    "nodeType": "document",
    "data": {},
    "content": [
      {
        "nodeType": "embedded-entry-block",
        "content": [],
        "data": {
          "target": {
            "sys": {
              "id": "57YAYGHQ1lXAEK6A0hyWgT",
              "type": "Link",
              "linkType": "Entry"
            }
          }
        }
      },
      {
        "nodeType": "paragraph",
        "content": [
          {
            "nodeType": "text",
            "value": "",
            "marks": [],
            "data": {}
          },
          {
            "nodeType": "embedded-entry-inline",
            "content": [],
            "data": {
              "target": {
                "sys": {
                  "id": "3G6tyfq4ObnjMmiQQL4eWb",
                  "type": "Link",
                  "linkType": "Entry"
                }
              }
            }
          }
        ],
        "data": {}
      }
    ]
  }
}