Eat The Richtext

A year and a half ago I vibe-coded a tool, Eat The Richtext, that I’ve been using practically every day[1] ever since. Friends tell me they continue to use it as well. I think that means it’s time for it to graduate from the blurb I put on LessWrong to a proper LessWrong post.

Ok, you know how sometimes you copy/​paste a chunk of text into Discord or GitHub Issues or a text message or anywhere else that doesn’t support rich text (aka RTF)? And then alllll of the following formatting disappears?

  1. Italics and bold

  2. Sub- or superscripts, like a2 + b2 = c2

  3. The numbers in a numbered list

  4. The bullets in a bulleted list

    1. Also nesting of lists

  5. Hyperlinks like eat-the-richtext

  6. TablesChairs
    dataelectric
    furniture
  7. Headers and subheaders

  8. Blockquotes

  9. Strikethrough

  10. <Code>

It’s the italics that are insidious in particular, since they’re hard to reliably spot and the meaning of the text can (occasionally) totally change if they’re stripped. This drives me bananas.

If you use various editors that support markdown, like Obsidian or Notion, they may have the solution to this built in. Copy the rich text in, copy markdown back out.

The rest of us can use this thing:

That’s what you see if you just copy the list above and paste it into the textarea on the left at, let me link you to it one more time, eat-the-richtext.dreev.es. The equivalent markdown magically appears on the right. You can click that little copy button to copy the markdown (or just select-all + copy) and then paste it into whatever plaintext-loving place you like.

(Notice that list numbering doesn’t quite play nicely with having a table in the list. I’m working on that. But I don’t think this problem is unique to Eat The Richtext. Google Docs also misunderstands the numbering, though a bit less badly, when you paste that list in.)

If you tried to copy that richtext from here in LessWrong directly to, say, Discord, you’d see this travesty:

And then all of the following formatting disappears?

Italics and bold

Sub- or superscripts, like a2 + b2 = c2

The numbers in a numbered list

The bullets in a bulleted listAlso nesting of lists

Hyperlinks like eat-the-richtext.dreev.es

Tables

Headers and subheaders

Blockquotes

Strikethrough

Oy! Before this tool I would usually paste that abomination and then manually markdownify it, double-checking to make sure I didn’t miss any italics and painstakingly adding the asterisks and whatnot. Now I let the rich text eater work its magic.

Or if you’re a weirdo who likes WYSIWYG you can use the left side as an editor and see the corresponding markdown on the right. Or vice versa. You can even jump back and forth, like if you forget the markdown syntax for something. Whatever you like!

It all happens automatically in real time as you paste or type and I think is plenty self-explanatory.

Colophon

For posterity, here’s my original prompt that I gave ChatGPT (4o) in May of 2024:

can you build a simple html/​javascript app with two text areas. the top text area is for rich text (rtf) and the bottom for plaintext markdown. whenever any text in either text area changes, the app updates the other text area. if the top one changes, it converts it to markdown and updates the bottom one. if the bottom one changes, it converts it to rich text and updates the top one.

I won’t say it one-shotted it, but with some hours of back-and-forth (15 hours total, but that includes writing this blog post), it got something usable without me writing any of the code. I was pretty blown away at the time. I’ve now had Codebuff helping to improve it.

PS: Have a referral link to Codebuff, a rationality-community-originating coding assistant (originally Manicode, spun out of Manifold Markets). Trying it via that link gets us both free credits.

PPS: The source code is on GitHub. And I should mention that Eat The Richtext is fully client-side. No backend and no concern with pasting in private text.

Thanks to Serine Molecule and Codebuff and Claude Code for help getting GitHub-flavored markdown tables to finally work.

  1. ^

    A few times over the last year and a half I got out of the habit of using Eat The Richtext and would find myself tediously reformatting and reitalicizing text after pasting to some plaintext-only place. Lately I have it in my bookmark bar and use it all the time again. Hopefully “eat the richtext” is memorable enough, and, with this post, googlable enough to find it next time you find yourself markdownifying lost formatting, or noticing too late that you turned a sentence like “Neil didn’t steal Mike’s bike” into “Neil didn’t steal Mike’s bike”.