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

Links: Link in text based blocks breaks when text is pasted inside the link and we add a space #28648

Open
desaiuditd opened this issue Feb 2, 2021 · 2 comments
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) Needs Technical Feedback Needs testing from a developer perspective. [Type] Bug An existing feature does not function as intended

Comments

@desaiuditd
Copy link
Member

Description

When user pastes a unicode character inside a link in the paragraph block or a list block, and then user types a space, the link breaks.

Step-by-step reproduction instructions

  • Create a new post in Gutenberg block editor.
  • Add a paragraph block and adds a piece of text.
  • Add a link to any part of the text in paragraph block.
  • Moves the cursor inside the link.
  • Copy a quote character from https://copychar.cc/
  • Paste inside the link in the paragraph block.
  • Press Spacebar key from keyboard.
  • Observe that the link is broken now.

Expected behaviour

Link should not be broken after unicode character is pasted and when user resumes typing inside the link.

Actual behaviour

Link is broken after unicode character is pasted and when user resumes typing inside the link.

Screenshots or screen recording (optional)

2021-02-02 16 41 44

WordPress information

  • WordPress version: 5.6
  • Gutenberg version: 9.8.0
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? Yes. Twenty Twenty

Device information

  • Device: MacBook Pro (16-inch, 2019)
  • Operating system: macOS 10.15.7 (19H114) Catalina
  • Browser: Chrome Version 88.0.4324.96 (Official Build) (x86_64)
@desaiuditd desaiuditd added [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) labels Feb 2, 2021
@gwwar
Copy link
Contributor

gwwar commented Feb 2, 2021

This is related to the paste action instead of any special characters. To reproduce:

  1. Add a link:

Screen Shot 2021-02-02 at 8 14 34 AM

<!-- wp:paragraph -->
<p>Hello <a href="http://google.com" data-type="URL" data-id="http://google.com">this is a test link</a> foo bar</p>
<!-- /wp:paragraph -->
  1. Copy some text into the clipboard (in this example its "bar")
  2. Paste the text in the middle of the link
  3. Add a space

Screen Shot 2021-02-02 at 8 13 46 AM

<!-- wp:paragraph -->
<p>Hello <a href="http://google.com" data-type="URL" data-id="http://google.com">this is bar</a> <a href="http://google.com" data-type="URL" data-id="http://google.com">a test link</a> foo bar</p>
<!-- /wp:paragraph -->

Expected: Link is not broken into two links (based on spacebar behavior without pasting)
Actual: Two links are created

@gwwar gwwar removed the Needs Testing Needs further testing to be confirmed. label Feb 2, 2021
@gwwar gwwar changed the title Links: Link in text based blocks breaks when a unicode character is pasted inside the link. Links: Link in text based blocks breaks when text is pasted inside the link and we add a space Feb 2, 2021
@kathrynwp
Copy link

I'm still able to replicate this with:

WordPress 6.0.1
Gutenberg 13.8.1 active or inactive
No other plugins active

@kathrynwp kathrynwp added the Needs Technical Feedback Needs testing from a developer perspective. label Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) Needs Technical Feedback Needs testing from a developer perspective. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants