I had a similar problem recently, and I think you should choose an output format that has a specification, i.e. HTML or markdown.
Because these formats can be read by other text parsers. If one day you don't want to use lexical, or your other components aren't able to use lexical, you can still easily use an off-the-shelf parser without having to reinvent the wheel.
So never use the JSON format, because its schema is not universal. As for using HTML or markdown, it depends on what your editor does.
If you're making a completely rich text editor, I think it's definitely better to store it as HTML, because storing it as markdown loses a lot of formats.
But if all you're making is a markdown editor, then storing as markdown would be better. After all ...... your goal is markdown isn't it? Storing as markdown ensures that no extra styles are added and there are more parsers to choose from.