def replace_jump_to_id_urls(text, course_id, jump_to_id_base_url):
 def replace_jump_to_id_url(match):
  quote = match.group('quote')
  rest = match.group('rest')
  return ''.join([quote, (jump_to_id_base_url + rest), quote])
 return re.sub(_url_replace_regex('/jump_to_id/'), replace_jump_to_id_url, text)

def replace_jump_to_id_urls ( text , course_id , jump_to_id_base_url ) : def replace_jump_to_id_url ( match ) : quote = match . group ( 'quote' ) rest = match . group ( 'rest' ) return '' . join ( [ quote , ( jump_to_id_base_url + rest ) , quote ] ) return re . sub ( _url_replace_regex ( '/jump_to_id/' ) , replace_jump_to_id_url , text )
this will replace a link between courseware in the format /jump_to_id/<id> with a url for a page that will correctly redirect this is similar to replace_course_urls .