A year and a half ago I vibe-coded a tool, Eat The Richtext, that I've been using practically every day (every week in any case) 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?
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.
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.
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.
Thanks to Serine Molecule for help getting GitHub-flavored markdown tables to (sort of) work.