Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#47705 closed defect (bug) (reported-upstream)

Gutenberg: Copy/Paste does not copy internal links href="#ID" as-is but replaces them with links to admin-side

Reported by: e467gj6x's profile e467gj6x Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.2.2
Component: Editor Keywords:
Focuses: Cc:

Description

Gutenberg editor interprets internal hyperlinks when copy/pasting. Not good.

I wrote a blog post with a table of contents, several chapters, and return-to-TOC -links. Something like this:

<h2 id="toc">Table of contents</h2>
<a href="#chapter1">Chapter 1</a>
<a href="#chapter2">Chapter 2</a>

...

<h2 id="chapter1">Chapter 1</a>
Really important stuff here, really.
<a href="#toc">Return to table of contents</a>

Now, If I ever need to EDIT this page and I copy/paste any of these links in the editor, then #chapter1 is no longer #chapter1 but an explicit link to the admin-interface. And #toc is no longet #toc but an explicit link.

Those explicit links work as long as I stay logged in, but when the world (my friends probably) accesses my writings, there will be no page-internal links but instead references to the admin side.

I want #ref to stay #ref, explicitly, when copy/pasting.

Change History (4)

#1 @SergeyBiryukov
5 years ago

  • Component changed from General to Editor

#2 @mygfxx1
5 years ago

test

Version 0, edited 5 years ago by mygfxx1 (next)

#3 @mygfxx1
5 years ago

  • Keywords x added
Last edited 5 years ago by mygfxx1 (previous) (diff)

#4 @pento
5 years ago

  • Keywords x removed
  • Milestone Awaiting Review deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed

Thank you for the bug report, @e467gj6x!

We have a report of a similar (I think related) issued in GB14928. To keep all the discussion in one place, I'm going to close this ticket in favour of that one, as the issue is best tracked in the Gutenberg repository.

Note: See TracTickets for help on using tickets.