Opened 8 years ago

Closed 8 years ago

#13565 closed defect (fixed)

PasteFromWord plugin for Editor doesn't work well with Office 2010

Reported by: William Riley Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.8
Component: Editor Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:

Description

In Office 2010, when pasting rich content, Word likes to put in <o:p> tags, like this:

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;
color:#0D0D0D;mso-themecolor:text1;mso-themetint:242"><o:p>&nbsp;</o:p></span></p>

The current set of filters doesn't account for this. The issue is more visible in Chrome than Firefox (Firefox converts it to just a straight <p> tag iirc, chrome preserves it), but present in both. I can't speak for IE, but I've noticed that in IE, the editor adds <br> tags for some odd reason (probably unrelated).

I find that adding a filter at the top of _filters that strips out <o:p> tags works, but it may not be the best solution:

{
    regexp: /<(\/?)o\:p[^>]*>/gi,
    handler: ""
}

From the cases I've run into, I haven't seen <o:p> contain any content, but further testing may be needed.

Attachments (1)

13565.patch (1.2 KB) - added by Jared Jurkiewicz 8 years ago.
Patch to include o:p stripper logic.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 8 years ago by Douglas Hays

Component: Dijit - FormEditor
Owner: Douglas Hays deleted

comment:2 Changed 8 years ago by Jared Jurkiewicz

Owner: set to Jared Jurkiewicz

Changed 8 years ago by Jared Jurkiewicz

Attachment: 13565.patch added

Patch to include o:p stripper logic.

comment:3 Changed 8 years ago by Jared Jurkiewicz

The suggested filter seems to work good from some testing. Waiting until after 1.7 finishes RC before committing.

comment:4 Changed 8 years ago by Jared Jurkiewicz

Milestone: tbd1.8

comment:5 Changed 8 years ago by Jared Jurkiewicz

Status: newassigned

comment:6 Changed 8 years ago by Jared Jurkiewicz

Resolution: fixed
Status: assignedclosed

In [27074]:

Fixing PasteFromWord? filters to filter out the o:p tags. \!strict fixes #13565

Note: See TracTickets for help on using tickets.