Skip to content

Newline added by astToHtmlString for link object #123

@ysazak

Description

@ysazak

Hello,

astToHtmlString method adds a newline (\n) and whitespaces around a link object.

Input richtext object:

{
  "children": [
    {
      "type": "paragraph",
      "children": [
        {
          "text": "Lorem ipsum dolor sit amet, "
        },
        {
          "type": "link",
          "href": "https://google.com",
          "children": [
            {
              "text": "consectetur "
            }
          ]
        },
        {
          "text": "adipiscing elit, sed do ..."
        }
      ]
    }
  ]
}

Output:
<p>Lorem ipsum dolor sit amet, \n <a href="https://google.com" target="_self" >\n consectetur \n </a>\n adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions