This means we now do a lookbehind from the slash after `[ur]`, then do a lookahead to validate the subreddit / user name. Also, add add proper lookbehinds to detect escaped legacy shortlinks, `max_lookbehind` is how far back we can look, `max_rewind` is how back we can touch. This helps us distinguish `\\/r/foo` from `\/r/foo`, and `r/foo` when looking back from the second forward slash.
Also test entities that should work as well as stuff that should be filtered (whoops!)
Previously it was possible to get the renderer to truncate the output at a point that would cause it out output unbalanced tags, for ex. `/r/irc://foo.bar` -> `<a href="/r/irc">/r/irc<<a href="irc://foo[…]` Not great. This commit attempts to mitigate that by tracking the end of the last inline and making sure rewinds don't run past it. This is similar to the approach taken by @vmg in rinku: vmg/rinku@dc685c1
Control characters == 2 in the escape table, don't skip by those!
QtCreator probably stole them with its strange touchpad gestures. Oops!
This fixes an issue where the beginning of an email would have its underscores treated as emphasis delimiters, then would decide it was an email when it hit the '@'. Since there's no easy way for the rewind code to account for that, and it can rewind back into the middle of a tag, we just don't touch bare email addresses.
`strchr("foo", '\0')` returns non-null, who knew.