rich-text icon indicating copy to clipboard operation
rich-text copied to clipboard

Newline added by astToHtmlString for link object

Open ysazak opened this issue 1 year ago • 0 comments

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>

ysazak avatar Feb 05 '24 15:02 ysazak