Better logic to handle backslashes

is_escaped actually counts backslashes instead of looking back one
character to determine whether a character is escaped. This handles
inputs like *Foo\\* correctly (as `<p><em>Foo\<em></p>`; would be
`<p>Foo\*</p>` previously).