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

[Bug]: Isolated space present inside the span tag is ignored while parsing #4822

Closed
2 tasks done
ashu12chi opened this issue Jan 23, 2024 · 3 comments
Closed
2 tasks done
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@ashu12chi
Copy link

Which packages did you experience the bug in?

core, textStyle

What Tiptap version are you using?

2.1.16

What’s the bug you are facing?

Hi,

Whenever isolated space is present inside a span tag, the space is ignored and not rendered properly in the editor in v2.1.16. (This was working in v2.1.13)

The following code can be used to reproduce the issue:

const editor = useEditor({
    extensions: [StarterKit],
    editorProps: {
      attributes: {
        class: "Editor",
      },
    },
    content: `
      <h1>Welcome to your fresh Tiptap Code Sandbox</h1>
      <p><span><b>Hello</b> <i>World</i></span></p>
    `,
  });

  return (
    <div className="App">
      <EditorContent editor={editor} />
    </div>
  );

Preview in v2.1.16: (Ref)
image

Preview in v2.1.13: (Ref)
image

What browser are you using?

Chrome

Code example

https://codesandbox.io/p/sandbox/xenodochial-chaplygin-sk6hy9

What did you expect to happen?

The behavior should be same as v2.1.13.

Anything to add? (optional)

No response

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@ashu12chi ashu12chi added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Jan 23, 2024
@github-project-automation github-project-automation bot moved this to Triage open in Tiptap Jan 23, 2024
@jacksongross
Copy link

Can confirm the same behaviour for me in 2.1.16 when using anchor tags within a strong tag. Works fine in 2.1.15 for me, so I think it has something to do with the recent changes added to remove whitespace when calling setContent on the editor.

@Chaddeus
Copy link

Oh, this might be what I am experiencing. I had thought that editor.chain().insertContent(' ').scrollIntoView().run() was not inserting spaces - #4833

@bdbch
Copy link
Member

bdbch commented Jan 29, 2024

I'm taking a look into this issue, ty for reporting.

@bdbch bdbch closed this as completed Jan 29, 2024
@github-project-automation github-project-automation bot moved this from Triage open to Done in Tiptap Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
No open projects
Archived in project
Development

No branches or pull requests

4 participants