Opened 12 years ago
Closed 12 years ago
#22941 closed defect (bug) (wontfix)
TinyMCE Paste From Word Uses <b> for Bold Instead of <strong>
Reported by: | cgrymala | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.5 |
Component: | TinyMCE | Keywords: | close |
Focuses: | Cc: |
Description
I'm not sure if this counts as a bug or not, but it's a definite change between 3.4.2 and 3.5.
Steps to Reproduce:
- Create a new Microsoft Word document
- Type some text into the Word document and make it bold
- Create a new post/page in WordPress, making sure that the Visual Editor is selected
- Copy the bold text from Word and use the Paste From Word button to paste it into the new post/page you're creating
- Switch to the HTML editor and look at the code
Expected Result:
- The background HTML code for the bold text should be wrapped in
<strong></strong>
Actual Result:
- The background HTML code for the bold text is actually wrapped in
<b></b>
Tested in WordPress 3.5 using Chrome 23.0.1271.97 m on Windows 8 x64. I'll test in other browsers later.
I tested in a WordPress 3.4.2 installation in the same setup, and those same steps produced text that was wrapped in <strong></strong>
correctly.
Change History (7)
#2
@
12 years ago
- Cc mdhansen@… added
I was able to confirm this, I also test italic text and it used <i> instead of <em>
#3
@
12 years ago
In fairness, this may have been a deliberate change. b and i are valid HTML5 elements that mean bold text and italic text. strong and em are forms of emphasis. Should bolded text in Word have the extra semantic meaning of emphasis, or is it simply bold?
#4
@
12 years ago
Yea, reading on whatwg does show these as valid. I guess the question is why only when paste from Word. If you use the Bold or Italic buttons from TinyMCE it uses <strong> or <em>
#5
@
12 years ago
In 3.5 TinyMCE follows the HTML 5.0 spec and as @nacin said <b> and <i> are valid elements there.
When pasting from MS Word and some other apps (and from another tab in the browser), the clipboard contains html. The 'paste' plugin filters it for irregularities and removes redundant classes, etc. but if the clipboard contains these elements they will be left untouched. The same happens when a user types in the Text tab, <b> and <i> are not replaced as they are valid and not deprecated any more.
Moving to 3.5.1 for review.