WYSIWYG editor for Document

Implemented Mercury editor.