def get_link_to_referenced_comment(subreddit_name, user_note):
    """Extracts the id of the comment referenced by the usernote and formats it as a reddit-internal link"""
    link_code_segments = user_note['l'].split(',')
    if len(link_code_segments) == 3:
        submission_id = link_code_segments[1]
        comment_id = link_code_segments[2]
        return '/r/{0}/comments/{1}/x/{2}/?context=3'.format(subreddit_name, submission_id, comment_id)
    else:
        return None