Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#32357 closed defect (bug) (fixed)

Pasting a URL on top of another URL links first URL, not replaces it.

Reported by: rhyswynne's profile rhyswynne Owned by: iseulde's profile iseulde
Milestone: 4.3 Priority: normal
Severity: normal Version: 4.2
Component: TinyMCE Keywords: has-patch
Focuses: Cc:

Description

Suppose if I have a URL http://www.foo.com/, that I want to replace in a piece of text with http://www.bar.com. If I select http://www.foo.com and paste over it, rather than replace said URL, it links it instead.

Trivial, really (user can delete old URL & paste new one), but I suppose that most people would prefer having http://www.bar.com, rather than
<a href="http://www.bar.com/">http://www.foo.com/</a>.

Attachments (1)

32357.patch (896 bytes) - added by iseulde 10 years ago.

Download all attachments as: .zip

Change History (7)

#1 @DrewAPicture
10 years ago

  • Keywords needs-patch dev-feedback added

Hi @rhyswynne. At its base, this is intended behavior, though I agree this is not a great experience. I actually ran into this myself a couple of times during the 4.2 development cycle before I realized this change had been made. Found it kind of annoying, really.

Personally, I would be in favor of allowing exceptions to the "paste-over linking" effect, such as your example of simply trying to replace a URL in content.

#2 follow-up: @helen
10 years ago

I'm not sure I'd expect it to replace. What is the flow here that we've got plain text URLs in the first place? oEmbeds that didn't work?

#3 @helen
10 years ago

  • Version changed from trunk to 4.2

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

Replying to helen:

I'm not sure I'd expect it to replace. What is the flow here that we've got plain text URLs in the first place? oEmbeds that didn't work?

Hi Helen,

At the moment it was a shortcode we were using for an internal project that had an image attribute. The shortcode was added as [shortcode backgroundimageurl="http://www.domain.com/image1.jpg"].... There were multiple instances of said shortcode on the same page, but with different background image urls, so I was copying the shortcodes out, and replacing the backgroundimageurl attribute.

Hope that helps :)

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

@iseulde
10 years ago

#5 @iseulde
10 years ago

  • Keywords has-patch added; needs-patch dev-feedback removed
  • Milestone changed from Awaiting Review to 4.3

I agree this is weird. If the selected content is a URL, then we should not link.

#6 @iseulde
10 years ago

  • Owner set to iseulde
  • Resolution set to fixed
  • Status changed from new to closed

In 32817:

TinyMCE: wplink: don't link a URL with a pasted URL

Fixes #32357.

Note: See TracTickets for help on using tickets.