Markus Over

Developing the Rich Text Editor for DeepL.com

Why did DeepL build its own rich text editor? The answer reveals the hidden complexities of `contentEditable`, from cursor management to messy clipboard data.

Developing the Rich Text Editor for DeepL.com
#1about 3 minutes

Why DeepL needed a custom rich text editor

Standard HTML textareas are insufficient for advanced features like word suggestions, rich text formatting, and visual diffs for the writing assistant.

#2about 4 minutes

The decision to build the DTextArea component

DeepL chose to build its own component to meet specific requirements like full customizability, a separate visual layer, and synchronized text areas.

#3about 1 minute

Using a virtual DOM for text representation

The editor uses a custom, minimal tree structure inspired by the DOM to represent text content and a separate visual layer for highlights.

#4about 6 minutes

The surprising complexity of handling line breaks

Line breaks are often implied by the HTML structure rather than explicit, requiring the editor to perfectly mimic inconsistent browser behavior.

#5about 6 minutes

Managing cursor position in a volatile DOM

To prevent the cursor from jumping during DOM cleanup, its position is converted from a node-offset pair to a stable character offset and back.

#6about 2 minutes

Supporting the Input Method Editor for non-latin languages

The Input Method Editor (IME) for languages like Japanese can break if the DOM is modified, requiring the editor to pause manipulations during composition.

#7about 4 minutes

Navigating browser bugs and external content issues

Challenges include browsers generating invalid HTML, inconsistent event orders, interference from browser plugins, and sanitizing complex clipboard content from apps like Microsoft Word.

#8about 2 minutes

Key learnings from building a rich text editor

The project revealed the deceptive nature of the 80/20 rule, as the final 20% of features required 80% of the effort.

#9about 2 minutes

Q&A on testing strategies and alternative editors

The team uses a full testing stack including unit, end-to-end, and property-based tests to find edge cases in the editor's behavior.

Related jobs
Jobs that call for the skills explored in this talk.

Featured Partners

Related Articles

View all articles
BR
Benjamin Ruschin
What Developers Really Need to Create Great Code Demos
Every developer on earth has, at some point, had another developer to thank for a breakthrough, a success, an aha moment they wouldn’t have had without coming across that blog post, that open-source contribution, that reply on socials or that humble ...
What Developers Really Need to Create Great Code Demos
DC
Daniel Cranney
Dev Digest 153: All about DeepSeek, Date in JS solved, AI makes us dumb
Inside last week’s Dev Digest 153 . 🤷‍♂️ Is AI creating a generation of illiterate programmers? 🐳 All you ever wanted to know about DeepSeek AI 🤑 Calculate how much that meeting you just had costs your company 👋 How to move on from React 💰 Google’s...
Dev Digest 153: All about DeepSeek, Date in JS solved, AI makes us dumb
CH
Chris Heilmann
Dev Digest 125 - Duck and Cover
This issue was written live at the WeAreDevelopers World Congress in Berlin with us being incredibly busy, but this shouldn't mean you don't get some hot resources. News and ArticlesLet's start with AI news: Google and Microsoft consume more power th...
Dev Digest 125 - Duck and Cover
CH
Chris Heilmann
Our tools: Text links to markdown converter
To create the Dev Digest newsletter each week, we collect a lot of links from various sources. On average, these are 50-80 links and we then cut them down to the most interesting ones. The first tool that helps us immensely in this is Clipbook, which...
Our tools: Text links to markdown converter

From learning to earning

Jobs that call for the skills explored in this talk.

Typescript Developer

Typescript Developer

Dabster
Charing Cross, United Kingdom

Java
Docker
JavaScript
TypeScript
Microservices
+1
Front End Engineer

Front End Engineer

Latent Labs
Charing Cross, United Kingdom

59K
REST
WebGL
React
Next.js
+6