Make WordPress Core

Opened 7 years ago

Last modified 3 months ago

#45691 new defect (bug)

In Code View Bolded Text Has Strong tag wrapped around each character

Reported by: codingsince007's profile codingsince007 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.0.1
Component: Editor Keywords: close
Focuses: Cc:

Description

When copying a word document over to create a new page, the formatting carries over...mostly. But when you look at the content in code view there are extra tags that is added which make the code look sloppy.

Here is a sample of the extraneous code added when viewing the code;

<p><strong>S</strong><strong>H</strong><strong>A</strong><strong>RING INFORMATION WITH ADVERTISERS </strong><strong>OR </strong><strong>OTHER THIRD </strong><strong>P</strong><strong>A</strong><strong>R</strong><strong>T</strong><strong>I</strong><strong>E</strong><strong>S</strong></p>

Why is it adding a strong tag around each character?

I am adding a screengrab of the Dev Tools and of WordPress 5.0 UI.

Attachments (2)

Guttenberg code view2.PNG (17.3 KB) - added by codingsince007 7 years ago.
Guttenberg Code View Extra Tags Created
Extra Strong Tags Added to Code.PNG (8.6 KB) - added by codingsince007 7 years ago.
Opera Developer Tools Code View Screenshot

Download all attachments as: .zip

Change History (5)

@codingsince007
7 years ago

Guttenberg Code View Extra Tags Created

@codingsince007
7 years ago

Opera Developer Tools Code View Screenshot

#1 follow-up: @joyously
7 years ago

  • Component changed from General to Editor

Did you try pasting the exact same thing into the Classic Editor, to isolate the culprit?

#2 in reply to: ↑ 1 @codingsince007
7 years ago

I have not. I know that Word sometimes causes issues but because most of the other text was fine it seems to be related to text that has bold formatting.

Replying to joyously:

Did you try pasting the exact same thing into the Classic Editor, to isolate the culprit?

#3 @r1k0
3 months ago

  • Keywords close added; needs-patch needs-testing removed

Reproduction Report

Environment

  • WordPress: 6.9
  • PHP: 8.4.17
  • Server: PHP.wasm
  • Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
  • Browser: Chrome 144.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.4
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.1

Steps taken

  1. Copy text from MS Word containing a bolded paragraph.
  2. Head over to Posts > Add Post paste the paragraph.
  3. Click the three dot button on the top right side of the screen.
  4. Under Editor section select Code Editor (You could use the code editor shortcut: Ctrl + shift + alt + m).
  5. Observe the tags wrapping the paragraph with the bold text.
  6. ❌ Bug is not occurring

Expected behavior

  • The bolded paragraph is wrapped in only one strong tag.

Additional Notes

  • This issue is no longer reproducible; it might have been fixed.
  • Unable to pinpoint the fix.
  • Marking this as close unless further reports confirm otherwise.

Screencast with results

https://imgur.com/a/E1imyx8

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