WordPress.org

Make WordPress Core

Opened 9 days ago

Last modified 2 days ago

#44348 new defect (bug)

Editor: Bold and Insert Anchor Link Bug

Reported by: atelierlabo Owned by:
Milestone: Awaiting Review Priority: normal
Severity: critical Version: 4.9.6
Component: Editor Keywords:
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 (4)

#1 follow-up: @subrataemfluence
9 days 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
9 days 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
6 days ago

I can reproduce this issue every time too.

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

#4 @atelierlabo
2 days 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"...

Note: See TracTickets for help on using tickets.