Skip to content

hardBreak does not support marks #16

@baka0815

Description

@baka0815

Given the following input:

<p><span style="color: #1f497d;">Test<br />Test</span></p>

the generated JSON/ADF is:

{
	"version": 1,
	"type": "doc",
	"content": [
		{
			"type": "paragraph",
			"content": [
				{
					"type": "text",
					"text": "Test",
					"marks": [
						{
							"type": "textColor",
							"attrs": {
								"color": "#1f497d"
							}
						}
					]
				},
				{
					"type": "hardBreak",
					"marks": [
						{
							"type": "textColor",
							"attrs": {
								"color": "#1f497d"
							}
						}
					]
				},
				{
					"type": "text",
					"text": "Test",
					"marks": [
						{
							"type": "textColor",
							"attrs": {
								"color": "#1f497d"
							}
						}
					]
				}
			]
		}
	]
}

As you can see the hardBreak does have the marks attribute which is invalid for that element (see https://developer.atlassian.com/cloud/jira/platform/apis/document/nodes/hardBreak/).

It seems to have something to do with the p-Tag, as

<span style="color: #1f497d;">Test<br />Test</span>

works fine and

<p style="color: #1f497d;">Test<br />Test</p>

does not.

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