The issue is that Discourse’s editor buttons manipulate the <input> content directly, so the browser doesn’t know what’s going on and therefore can’t manage the undo history. Changing the editor buttons to use a technique like this, rather than modifying the <input> element directly would probably help: