Edit: This torture test should become irrelevant very soon, since the discrepancies between the preview and final output have been resolved on S[OFU]. Hopefully, those changes will be merged into SE soon..
no conversion to italics/bold
word*ending*, mid*word*stuff, and * with * spaces on each side. *Internal_underscores* (or _stars * like_ this) break italics, even _like _ this_ . Spaces_ must_ be__ on__ the** correct** sides. _Leading underscores is break italics/bold, like _this and _this. f'_n=g'_n is left alone.
surprising conversions to italics/bold
*word*beginning. Surrounding}symbols!are often treated as spaces, but not always: {a}{b}={c}{d} is italic, but a _ b = c _ d is not. *Only *the innermost stars* match*, unless bold in italics. _Same for underscores_ _or mixed symbols_. Insanely, you can mismatch symbols to get _italics* or bold__! f'*n=g'*n is converted (a weird difference between *'s and _'s). **internal _'s and *'s (even __'s and **s) don't break bold (note that "s) don't" wasn't converted separately, indicating some sort of greedyness). Within bold, stars or underscores can add italics. Within italics, stars or underscores can add bold! Bold*italics*bold with stars in between. Internal _'s and *'s don't thwart conversion if they're escaped.
*Leading stars and trailing stars* don't thwart conversion, and trailing underscores_ don't either.
source for "surprising conversions" section
*word*beginning. Surrounding}_symbols_!are often treated as spaces, but not
always: {a}_{b}={c}_{d} is italic, but a _ b = c _ d is not. *Only *the
*innermost* stars* match*, *unless **bold** in* italics. _Same _for_
underscores_ _or *mixed* symbols_. Insanely, you can mismatch symbols to
get _italics* or **bold__! f'*n=g'*n is converted (a weird difference
between *'s and _'s). **internal _'s and *'s (even __'s and **s) don't**
break bold (note that "**s) don't**" wasn't converted separately, indicating
some sort of greedyness). Within __bold, *stars* or _underscores_ can add
italics__. Within _italics, **stars** or __underscores__ can add_ bold!
**Bold****italics****bold** with stars in between. *Internal \_'s and \*'s
don't* thwart conversion if they're escaped.
**Leading stars* and _trailing stars_* don't thwart conversion, and
*trailing underscores*_ don't either.

