The new paste handler needs some documentation, including how to test.
Some stuff that might be useful to include:
Testing book module: #repo/oerpub/test-book/edit/content/pasting-from-word-and-open-office-582cb3e8-d0a9-46d2-815f-b03d4cf73dec.html
Izak's email:
- The paste plugin creates an off-screen contenteditable div.
- The paste plugin adds a handler for the paste event, which redirects pastes into the off-screen div.
- When something is pasted, the content is collected from this div, and the insertHtml command is used to insert it into the real document.
- Aloha calls any content handlers registered for insertHtml on the content, and each of them gets a chance to modify the content.
- The result is inserted into the document
After a small css change (#123) the extra scrollbar issue in github-bookeditor is gone, so items 1 to 3 above works as advertised.
Item 4 needs a bit of work. If you get some word content, for example http://www.houstonmethodist.org/WordPasteTest, you'll see that it does clean up nicely, except MsoNormal remains. It also doesn't handle openoffice content, and it should clean up the use of entities (such as ย ) which isn't valid in xhtml5.
Info from the redmine ticket:
Information from Petro at Aloha:
Indeed Aloha Editor has a specific content handler just for processing content that originates from Microsoft Word and Open/Libre Office documents:
https://github.com/alohaeditor/Aloha-Editor/blob/master/src/plugins/common/contenthandler/lib/wordcontenthandler.js
More information on how to use the word content handler can be found in the Aloha Editor guides:
http://aloha-editor.org/guides/plugin_contenthandler.html#word-content-handler
http://aloha-editor.org/guides/plugin_contenthandler.html#using-configuration