WordPress.org

Make WordPress Core

Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#24155 closed defect (bug) (duplicate)

Visual editor adds span tags with style by itself

Reported by: GuillaumeP Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5.1
Component: TinyMCE Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Hello everyone,

I have noticed that the wordpress visual editor adds span tags with no reason. It happens when I create a bullet list or when I make a link.

I am able to reproduce the bug for bullet lists but I cant do it for the links. It seems to happen randomly.

To reproduce the bug for bullet list, I start with a title H3 then I click on the bullet list button. I start to write the list and then, when i save the draft, the first line has a span tag. This bug happens in several websites. Sometimes i get something like this :

<li><span style="line-height: 12.997159004211426px;"><strong>
or

<span style="font-size: 13px; line-height: 19px;">

I dont paste text from word to the visual editor. I write directy in the visual editor.

For links, I dont know when it happens, but I sometimes have a <span style="color:#333333">.

First, I thought i had the same bug than this one : #23461 which said it was a "long standing bug in WebKit"
but i had this bug in Firefox too which is not using Webkit but Gecko.

Then i thought it was a bug with the add_editor_style() function but it's not that too. I commented the function but the bug still happens.

Change History (7)

comment:1 SergeyBiryukov12 months ago

  • Component changed from General to TinyMCE
  • Description modified (diff)
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

First, I thought i had the same bug than this one : #23461 which said it was a "long standing bug in WebKit" but i had this bug in Firefox too which is not using Webkit but Gecko.

#23461 was closed as a duplicate of #17154. This appears to be a manifestation of the same bug, let's continue the discussion there.

comment:2 GuillaumeP12 months ago

Are you sure it is the same bug ? I have at least one website which is doing the same thing without TinyMCE editor

comment:3 follow-up: SergeyBiryukov12 months ago

Well, you specifically refer to Visual editor multiple times in the ticket description. The default visual editor in core is TinyMCE.

  1. Does this happen in Text editor too?
  2. Can you reproduce the issue on a clean install (with Twenty Twelve or Twenty Eleven theme activated and all plugins disabled)?

comment:4 in reply to: ↑ 3 ; follow-up: crushgear12 months ago

Replying to SergeyBiryukov:

Well, you specifically refer to Visual editor multiple times in the ticket description. The default visual editor in core is TinyMCE.

  1. Does this happen in Text editor too?
  2. Can you reproduce the issue on a clean install (with Twenty Twelve or Twenty Eleven theme activated and all plugins disabled)?

I was actually just looking at this bug too since it was reported by WordPress.com VIP users.

  1. No, I was not able to reproduce it in the text editor. It only appears if you add a list in visual mode, and when do you do that, the <span> tag appears around the first line of the list.
  2. I was able to reproduce it in a clean install running trunk.

comment:5 in reply to: ↑ 4 ; follow-up: SergeyBiryukov12 months ago

Replying to crushgear:

I was actually just looking at this bug too since it was reported by WordPress.com VIP users.

Thanks for additional info. Does it happen in Firefox too (as noted in this ticket), or in Chrome only (as noted in #17154 and #23461)?

comment:6 in reply to: ↑ 5 crushgear12 months ago

Replying to SergeyBiryukov:

Replying to crushgear:

I was actually just looking at this bug too since it was reported by WordPress.com VIP users.

Thanks for additional info. Does it happen in Firefox too (as noted in this ticket), or in Chrome only (as noted in #17154 and #23461)?

I wasn't able to replicate this bug in Firefox. In Chrome, it's a very consistent bug. Thanks!

Version 0, edited 12 months ago by crushgear (next)

comment:7 azaozz12 months ago

Spent a lot of time testing this, triggered by line-height in the editor stylesheets. Until this is fixed in Chrome, seems the only workaround is to not define line-height for any element, especially not on the <body> and <br>.

Last edited 12 months ago by azaozz (previous) (diff)
Note: See TracTickets for help on using tickets.