I am using Microsoft Word 2008 for Mac. Often why I copy/paste from Word into both FCKEditor and TinyMCE I am getting a

at the end of the body text which displays on the user view of the page.

Comments

twod’s picture

Status: Active » Closed (won't fix)

This is not inserted by Wysywyg module (it does not touch the contents, and should not do so to compensate for this), it comes from Word, which is notorious for this behavior. Try activating the "Paste from Word" plugin and use that button instead.

edwardrapley’s picture

Status: Closed (won't fix) » Active

This is happening for a client even whilst using the 'Paste from Word' button.

I accept that it is not the fault of Wysiwyg, but it does make the module less functional as many people create content in Word first then copy and paste.

Can the filters that are applied by the 'Paste from Word' button include this terms?

Or is there another way to remove them automatically?

Thanks for your time.

agerson’s picture

It too happens to me even when I use the 'Paste from Word' button. Perhaps the "bug" is in that button's functionality.

twod’s picture

Status: Active » Postponed (maintainer needs more info)

Is this happening from Word on Mac only, or with other browsers and apps on other platforms? I tried copy/pasting from Word, OO.org Writer and MS Works to Firefox and IE in Win XP and FF on Ubuntu but I can't reproduce this.

After some digging I found out that the <!--EndFragment--> might not be a problem created by Word (and no, no "Paste from Word" filters I've seen ever filtered these comments). The comment is an optional part of the clipboard HTML format in Windows. It should be filtered out by the application as it's used as an indicator of where the actual copied part ends and where the rest of the HTML context begins*. The browser should know this if it accepts clipboard content in HTML formats and not include the comment when pasting. It might also be that some version of Word accidentally puts two of these EndFormat comments in there when creating the clipboard contents, or maybe it shouldn't be included at all when running on a Mac, but I have no way of verifying this as I don't have a Mac or can confirm this is happening on other systems. I've tried searching for bug reports filed against browsers or other applications, but they usually refer to the entire clipboard format being pasted instead of just the copied portion, which is a completely different bug. I also need to narrow down my search parameters, but I don't know to what.

*The HTML clipboard format always contains a complete HTML document to make the copied fragment valid, see link for an explanation of the HTML Format (CF_HTML).

The filtering routines can be changed in some editors, references here for FCKeditor and TinyMCE. The easiest way to get this into Wysiwyg, without having to modify module/library files, is to create a new plugin for each editor using the above references (or copy/paste the original plugins and modify them), implement hook_wysiwyg_plugin() to tell Wysiwyg about the new plugins, deactivate the original plugins/buttons and activate the new ones instead.

One alternative is to only create an editor independent 'Drupal plugin' which implements the attach() and detach() method to run a custom filter on all contents passing through the editor. But Drupal plugins are currently expected to use a button, so you'd end up with an empty button which does nothing when clicked (inless you also implement the invoke() method).

sun’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

This is a bug in the original editor library and cannot be fixed in Wysiwyg API. Please consult the vendor's bugtracker or forum for solutions.

twod’s picture

Actually, it looks more like a bug in the browser or application from which the HTML was copied, as the <!--EndFragment--> is part of the clipboard format and should never have reached the editor.