-[NSAttributedString markdownRepresentation] doesn't handle overlapping bold and italic if they don't have the same range.
I'm not sure the assertion for @"_Italic **Bold**_" is valid. The Markdown syntax documentation makes no mention of scoping being a requirement (nor does HTML). It's more visual than structural: <i>Italic <strong>Bold</i></strong> looks the same as <i>Italic <strong>Bold</strong></i>.
The order operations in emitMarkdown could be changed to make the first test pass, but then the second one fails. The underlying cause is that the rich text representation doesn't have a notion of one style wrapping another (to give scope). It seems like a hard problem to solve and considering the spec doesn't require this, it feels like more a "nice to have" than "this is broken".
I'm going to leave this issue open and think about it more. Thanks for the unit tests, in any case!