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

Possible to paste links inside a button #12223

Closed
johngodley opened this issue Nov 22, 2018 · 3 comments
Closed

Possible to paste links inside a button #12223

johngodley opened this issue Nov 22, 2018 · 3 comments
Labels
[Block] Buttons Affects the Buttons Block [Feature] Paste [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Type] Bug An existing feature does not function as intended

Comments

@johngodley
Copy link
Contributor

The button block has format tools for bold, italic, and strikethrough. However, if you paste content it's possible to insert additional formatting, including links. This leads to nested links, which is not valid HTML.

Here's the button editor:

edit_post_ _wordpress_latest_ _wordpress

And copy/pasting some text with links results in this:

edit_post_ _wordpress_latest_ _wordpress

Looking at the HTML we have nested links:

<div class="wp-block-button">
  <a class="wp-block-button__link">She is also the daughter of <a href="http://mlp.wikia.com/wiki/Twilight_Velvet_and_Night_Light">Twilight Velvet and Night Light</a></a>
</div>

To Reproduce
Steps to reproduce the behavior:

  1. Create button block
  2. Copy some text from a web page with links
  3. Paste into the button

Expected behavior
Links to be stripped

@johngodley johngodley added [Type] Bug An existing feature does not function as intended [Component] Button labels Nov 22, 2018
@johngodley
Copy link
Contributor Author

Also noting that after saving the post and then reloading the page, the block is shown invalid.

@mtias mtias added this to the WordPress 5.0.1 milestone Nov 23, 2018
@mtias mtias added [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Block] Buttons Affects the Buttons Block [Feature] Paste and removed [Component] Button labels Nov 23, 2018
@ellatrix
Copy link
Member

Duplicate of #7591.

@Inwerpsel
Copy link

Inwerpsel commented Jan 6, 2020

Duplicate of #7591.

The referred ticket would create an interface that would allow to more easily fix this issue, but it would not do so by itself, so really it's not a duplicate of this one. This is a bug report, so why close it unless the bug is fixed or there is an other bug report that duplicates it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Buttons Affects the Buttons Block [Feature] Paste [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants