Make WordPress Core

Opened 10 years ago

Closed 8 years ago

#37970 closed defect (bug) (worksforme)

Editing anchor link after copying adds admin url

Reported by: philliproth Owned by:
Priority: normal Milestone:
Component: TinyMCE Version:
Severity: normal Keywords:
Cc: Focuses:

Description

I have a small image e.g. an arrow with an anchor link on it e.g. "#section1". I copy this image and want to edit the link. Then it adds the complete admin url to the link like this: ​http://www.someboringsite.com/wp-admin/post.php?post=12&action=edit#section2

Attachments (1)

screenshot.jpg​ (10.9 KB ) - added by philliproth 10 years ago.
Screenshot

Download all attachments as: .zip

Change History (6)

@philliproth
10 years ago

Screenshot

#1 @flixos90
10 years ago

  • Milestone Awaiting Review → Future Release
  • Version 4.6

Thanks for the ticket @philliproth! Replicating this problem, it happens on any kind of link, not related to the image. I couldn't quite figure out where this problem comes from as I'm not familiar with the editor functionality, but the problem has been around for a while. I tested it on 4.4 (happens there as well) and 3.7 (doesn't happen there, but we didn't have the inline link popover back then).

It might be a bug on the paste plugin for TinyMCE since the content reaches the wplink plugin already in the incorrect way, but this is mostly me guessing.

#2 follow-up: @flixos90
10 years ago

Actually I just noticed the link is incorrect when you paste it, but it turns into the expected correct link after you hit Publish / Update on the post.

#3 @azaozz
10 years ago

  • Component Editor → TinyMCE

This is a problem (or is it a "feature") in the browsers when pasting HTML in contentEditable. As far as I remember it used to happen only in Firefox, years ago. It is fixed when inserting links in TinyMCE, but seems it is happening on pasting in some cases.

Passing upstream for more investigation.

#4 in reply to: ↑ 2 @azaozz
10 years ago

Replying to flixos90:

Actually I just noticed the link is incorrect when you paste it

Looking a bit more, I think the rest of the absolute URL is added on copying the link. Try to copy such link from another site/domain.

This appears to be the way the browsers work when you copy a link whose href consist only of a fragment, i.e. <a href="#something">test</a>. Not really sure we or the TinyMCE devs can do much about that. It "looks like" a standard URL on pasting.

Last edited 10 years ago by azaozz (previous) (diff)

#5 @desrosj
8 years ago

  • Milestone Future Release
  • Resolution → worksforme
  • Status new → closed

I'm going to close this out. I am currently unable to reproduce this in the Classic Editor, or the block editor. It was probably fixed in another ticket.

Note: See TracTickets for help on using tickets.