Empty lines should simply be represented as `<p><br></p>` this sets up `contenteditable=true` to add content to the line compared to just `<br>` and also Gemini has no "empty" line-type just a line that is empty.
The `<a>` for a link should be presented without any parent elements. Many implementations use `<div>` to enforce "block" styling as opposed to the default "inline" which renders the link next to the previous block instead of below it. But the nested markup adds an unnecessary layer of indirection in semantics and when parsing. If you must wrap the link it should be with a `<p>` tag and never a `<div>`. If you do not wrap the link a simple `a {display: block}` has the same effect (gmi.css uses this).
Some implementations render a series of `>` into a series of `<blockquotes>` which is probably fine but it is semantically preferable to group them and insert the subsequent lines as `<div>line-breaks</div>`.
Parsers may want to be aware of potential `<br>` lines inside `<pre>` tags as that is how "enter" is handled when `contenteditable=true`. It is uncertain why the browser behaves so but they can be safely translated to \n. and you need not translate `\n → <br>` as that's implied in "preformatted".