Note. This is only a bug in the markdown editor. The resulting rendered output is correct.
Markdown and HTML can mix just fine ... in a markdown document. You just have to honor spacing between block elements and the markdown content. That's how styling is applied for example. I do whole complex-ish webpages in markdown. Floats, flex elements, everything.
Do this is Joplin and look at the rendered output. Discourse treats it right but strips out the styling or I would show you here:
> <div style="padding-left: 5.0vw; text-indent: -2.5vw; width: 50%; font-size: 85%;">
>
> This is an example of a _hanging indent_ (in Joplin) set up so you can see the power of HTML mixed with markdown. But, you will notice that **this is markdown**.
>
> </div>
Same as with span and other inline HTML. It just does the right thing:
> <span>This is inside of a span, but **it's <s>html</s> still markdown**.</span>
<div>
## TEST HEADING0
Now, if add some URLs in their various formats, sometimes the syntax highlighting in the editor gets screwy in Joplin.
[https://example.com](https://example.com) https://example.com <https://example.com>
As you can see even in Discourse comments it does something ... different. BUT the difference stops within the <>s. In Joplin, it screws up the syntax highlighting for everything after the link in angle-brackets. For example, the ## TEST HEADINGs will no longer syntax highlight and be boosted in font size in the editor. All because of that link.
## TEST HEADING1
</div>
## TEST HEADING2
Just try it, and then try again removing the bracketed link, and then do the same but remove the divs. I think you will see what I mean. I hope anyway.
I determined that the markdown editor (and thankfully, not the markdown renderer) thinks that <https://example.com> is an unterminated HTML element. For example, <https://example.com/> sets everything straight again following the link. Definitely a bug.
Note: This is the case for some html elements, but not all. For example anything wrapped in the pre html tag will not be rendered (as expected).
The markdown editor (CodeMirror) uses a very simplistic parser and as such it can't handle situations like html inside markdown inside html. The new version of CodeMirror will have a better parser, so maybe it will be able to handle this situation. Either way, upgrading is not exactly on the horizon.