We were trying to link to each media item using its
`url`/`expanded_url`. But there is only one of these, shared across
all of a tweet's media items. So attempting to put it in several times,
in the same location, was a bit of a mess!
So it now only puts the `url`/`expanded_url` in once, no matter
how many media items there are.
If a tweet was a reply, then when `html_for_tweet()` tried to turn
the initial "@username" into a link, there was:
> NameError: name 'sub_expr' is not defined
This is now fixed, with a test to ensure the "@username" becomes
a link.
I've re-written the parts of `html_for_tweet()` so that it handles
all the replacements of URLs, mentions, symbols and hashtags better.
Mainly to fix#447 but it should be a little more robust generally.
Shamelessly cribbed from https://stackoverflow.com/a/25514650/250962
Passes all tests, but I haven't checked it beyond that.
Fixes#447