WordPress.org

Make WordPress Core

Opened 22 months ago

Last modified 22 months ago

#40204 new defect (bug)

Pasting a URL over a shortcode attribute shouldn't produce a link

Reported by: johnbillion Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.3
Component: Editor Keywords: needs-patch
Focuses: javascript, administration Cc:

Description

Steps to reproduce:

  1. Ensure you're on the Visual tab in the post editor.
  2. Add the following shortcode to the post content: [foo bar="http://example.com"].
  3. Copy a different URL into your clipboard and paste it over the contents of the bar attribute.

Expected behaviour is that the URL gets replaced with the URL from your clipboard.

Actual behaviour is that the value of the bar attribute gets converted into a link anchor, due to the automatic linking functionality in the editor.

Related: #38628.

Change History (1)

#1 @lukecavanagh
22 months ago

@johnbillion

I get this when you view in the text editor, so copied the Google URL and pasted in visual tab of the editor, over the http://example.com original URL.

[foo bar="<a href="https://www.google.com/">http://example.com</a>"]
Note: See TracTickets for help on using tickets.