Skip to content

Inline code mark incorrectly combined with other marks (e.g., strong), producing invalid ADF #5

Description

@NoahCardoza

I found a small bug in the marks processing.

An element cannot be marked as code AND something else like bold, etc.

For example, the following markdown produces the JSON that doesn't comply with the ADF spec.

This **will \`fail\` to** generate ADF correctly.
{
  "version": 1,
  "type": "doc",
  "content": [
    {
      "type": "paragraph",
      "content": [
        {
          "type": "text",
          "text": "This "
        },
        {
          "type": "text",
          "text": "will ",
          "marks": [
            {
              "type": "strong"
            }
          ]
        },
        {
          "type": "text",
          "text": "fail",
          "marks": [
            {
              "type": "code"
            },
            {
              "type": "strong"
            }
          ]
        },
        {
          "type": "text",
          "text": " to",
          "marks": [
            {
              "type": "strong"
            }
          ]
        },
        {
          "type": "text",
          "text": " generate ADF correctly."
        }
      ]
    }
  ]
}

You can test the ADF here: https://developer.atlassian.com/cloud/jira/platform/apis/document/viewer/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions