WordPress.org

Make WordPress Core

Opened 13 months ago

Last modified 5 months ago

#44348 new defect (bug)

Editor: Bold and Insert Anchor Link Bug

Reported by: atelierlabo Owned by:
Milestone: Awaiting Review 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 (6)

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

I can reproduce this issue every time too.

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

#4 @atelierlabo
12 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
11 months ago

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

#6 @desrosj
5 months 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?

Note: See TracTickets for help on using tickets.