fix some bugs, fix escaping, handle links to tickets