molikto’s weblog

Comparison & Observation of Rich Text Editors

Types of text editors

WYSIWYG

WYSIWYG editor is a system in which content (text and graphics) can be edited in a form closely resembling its appearance when printed or displayed as a finished product
— Wikipedia

Structural editor

A structure editor, also structured editor or projectional editor, is any document editor that is cognizant of the document’s underlying structure.
— Wikipedia

Plain text editors with live preview

the plain text itself might be parsed into a AST. but you are not editing the AST, but editing that plain text, and you need to take care yourself if the edited result can be parsed or not

examples of this kind is not included in this comparison, these are basically plain text editors, with syntax highlighting. example: StackEdit

differences between WYSIWYG and structural editor

there are editors that are both structural and WYSIWYG. compare them with this example:

there are also other differences: structural editor usually has some semantical AST construction (heading), while WYSIWYG editor usually has some surface AST construction (font, font size). but there is no hard rules

differences between a plain text editor and structural editor

structural editor might has different editing operations you can perform. also the presentation is more “WYSIWYG” than plain text editors, for example, showing a url with no url plain text (but a modal dialog to edit the url), displaying images inline (instead of a url/file name)

Common data model

our data model will be similar to something like this:

Document = [Block]
Block = BlockType1(content: [Inline]) | BlockType2(blocks: [Block])
Inline = PlainText(string: String) | FormatedInline(format: Format, content: [Inline]) | EmbededImage(url: String)

so there are Document which is a list of blocks and each block is either again some blocks (for example, Blockquote(blocks: [Block])) or a list of Inline elements

Aspects

candidates

TeXmacs

Bear.app

web based WYSIWYG editors

seems all work the same to me…