Rewrite jump_to_id links
Cherry-picked the $. encoding