Note: You are currently viewing documentation for Moodle 3.3. Up-to-date documentation for the latest stable version of Moodle is probably available here: HTML editor 2.0.

Development:HTML editor 2.0

From MoodleDocs

This page details the specification of the HTML editor in Moodle 2.0.

What we want

Ticket MDL-11113 discusses most issues.

Requirements

  • Integration - With Moodle (smileys, different formats, etc.) with a minimum of changes, cleaning up current code as much as possible
  • Compatibility - With web browsers (mostly FF, IE, Safari, Opera)
  • Standard - Outputs valid XHTML code
  • Accessibility - Is it 100% keyboard accessible? Is it usable in JAWS? Etc.
  • Configurability - Possibility to make it show different options and buttons according to the user, the context, etc.
  • Support - Developed by an active community that will support it for a long time.

Features

Some features that should be evaluated:

  • Handling of Word documents
  • HTML code direct editing
  • Highlighting (not text background color, with "set-on" operation--Word style)
  • Image uploading
  • Mathematical formulas/equation editing
  • Possible to turn it on and off on demand (on the page) without losing (possibly modified) content (see this TinyMCE example of this)
  • Right-to-left text input
  • Smileys (has to be possible to use the Moodle list of smileys)
  • Special characters
  • Tables
  • Themeable (possible to make a theme that fits with Moodle's)

Wishes

  • Make it possible to change to a different editor (provided someone comes up with the necessary code to "plug it" in Moodle)
  • Possible to run many instances on the same page (see MDL-11101 in tracker)
  • Fix all the bugs related to the HTML editor
  • Submit drafts in the background, using ajax.

Possibilities and evaluation

As of 16 April 2008, the preference goes to TinyMCE.

Plan of action

  • Get code in HEAD before 13 May 2008 so that work can be done there
  • Have the XHTML profile active by default in TinyMCE

Change in formats

This is actually more a related issue... There is a [| long-standing bug] about Markdown not being converted to HTML when using the HTML editor (after creating a post with Markdown). As the HTML editor becomes available on more browsers (and being more stable), most people will probably want to use it instead of Markdown, so we should solve this bug, by properly converting the Markdown text to HTML, the first time it is displayed in the editor.

Plugins to write

Some plugins will have to be written for each editor to make integration with Moodle possible. These should be as abstracted as possible, to make as much code as possible common between each

  • Language files: Moodle has a lot more languages than any editors, and some strings will be Moodle-specific. We need a way to make the editors use Moodle strings
  • File browser: the file browser (especially with the Repository API) will be Moodle specific
  • Emoticons (smileys): Moodle defines it's own list of emoticons, we need to make a plugin to use them
  • Equation editor: there is ongoing work to get Dragmath working in Moodle, making a common plugin could be a nice improvement
  • It may be possible to use Moodle's CSS files to define editors themes/skins, this needs investigation

Links to forum discussions, tracker, docs, etc.

Using Moodle General developer forum discussions: