Properly format reference links