Handle the cases when an issue ref is the first or last thing on a line.