oerpub / Aloha-Editor

OERPUB Aloha Editor is a repo for the development of Aloha plugins, models, tests, and examples for use in the production of books and open educational resources. We intend to commit all code back to Aloha when plugins reach maturity.
http:/oerpub.github.io/Aloha-Editor/
Other
22 stars 11 forks source link

Document the new paste handler in https://github.com/oerpub/Aloha-Editor/tree/master/doc #125

Closed kathi-fletcher closed 10 years ago

kathi-fletcher commented 10 years ago

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:

  1. The paste plugin creates an off-screen contenteditable div.
  2. The paste plugin adds a handler for the paste event, which redirects pastes into the off-screen div.
  3. When something is pasted, the content is collected from this div, and the insertHtml command is used to insert it into the real document.
  4. Aloha calls any content handlers registered for insertHtml on the content, and each of them gets a chance to modify the content.
  5. The result is inserted into the document

After a small css change (https://github.com/oerpub/Aloha-Editor/pull/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
kathi-fletcher commented 10 years ago

Closing for now.