Make WordPress Core

Opened 7 years ago

Closed 6 years ago

#44348 closed defect (bug) (duplicate)

Editor: Bold and Insert Anchor Link Bug

Reported by: atelierlabo's profile atelierlabo Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Editor Keywords: close reporter-feedback
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 (8)

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

I can reproduce this issue every time too.

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

#4 @atelierlabo
7 years 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
7 years ago

  • Keywords needs-patch added
  • Severity changed from critical to blocker

#6 @desrosj
6 years ago

  • Keywords close reporter-feedback added; needs-patch removed
  • Severity changed from blocker to normal
  • Version 4.9.6 deleted

Hi @atelierlabo!

I have been doing some testing on this. I was able to consistently reproduce this in WordPress 4.9 and in 5.0 when using the Classic Editor plugin (it does not happen when using the new block editor).

In WordPress 5.1 (which is only in the stages currently), I cannot get the issue to happen in either editor.

I think that this was fixed in a commit to WordPress 5.1 (maybe #46071). This is a list TinyMCE of tickets modified since WordPress 5.0 was released. The ticket is in there somewhere.

@atelierlabo and @munyagu, are you able to test the latest 5.1 beta to see if you are still experiencing the issue?

#7 @noisysocks
6 years ago

This is a duplicate of #46071 which is fixed as of 5.1.

#8 @noisysocks
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #46071.

Note: See TracTickets for help on using tickets.