WordPress.org

Make WordPress Core

Opened 7 months ago

Last modified 6 months ago

#44348 new defect (bug)

Editor: Bold and Insert Anchor Link Bug

Reported by: atelierlabo Owned by:
Milestone: Awaiting Review Priority: normal
Severity: blocker Version: 4.9.6
Component: Editor Keywords: needs-patch
Focuses: Cc:

Description

  1. In blank editor, type a few words
  2. Click "B" (bold) button and type a few words in bold.
  3. Click "B" (bold) button again to disable bold. Now, type a few words again.
  4. Select/highlight the last few words (after the bolded words). Click "Insert/edit link" button. Click "Link options" and then insert the URL by typing or select an existing post/page. Click "Add Link" to insert the anchor link.
  5. The hyperlinked words will be moved to behind the bolded text automatically.

https://imgur.com/a/OEi2HIa

Change History (5)

#1 follow-up: @subrataemfluence
7 months ago

Welcome to Trac! I confirm that I could reproduce the issue using a fresh WordPress install.

However, the interesting part is I could reproduce it only once. After this I tried many a times but everything worked normally and the issue did not show up any more!

Screen cast: https://goo.gl/cRcNSp

#2 in reply to: ↑ 1 @atelierlabo
7 months ago

Replying to subrataemfluence:

Welcome to Trac! I confirm that I could reproduce the issue using a fresh WordPress install.

However, the interesting part is I could reproduce it only once. After this I tried many a times but everything worked normally and the issue did not show up any more!

Screen cast: https://goo.gl/cRcNSp

I can reproduce this issue every time...

#3 @munyagu
7 months ago

I can reproduce this issue every time too.

https://imgur.com/a/8dihKAh

#4 @atelierlabo
7 months ago

It was this line in wp-includes/js/wplink.min.js (or wp-includes/js/wplink.js for the unminified version) that's causing the issue:

Line 447:

if ( $mceCaret.length ) {
  $mceCaret.before( $link.removeAttr( 'data-mce-bogus' ) );
}

It seems the anchor link was positioned before the "caret"...

#5 @atelierlabo
6 months ago

  • Keywords needs-patch added
  • Severity changed from critical to blocker
Note: See TracTickets for help on using tickets.