Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newline added by astToHtmlString for link object #123

Open
ysazak opened this issue Feb 5, 2024 · 0 comments
Open

Newline added by astToHtmlString for link object #123

ysazak opened this issue Feb 5, 2024 · 0 comments

Comments

@ysazak
Copy link

ysazak commented Feb 5, 2024

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant