def _plugin_replace_role(name, contents, plugins):
 for p in plugins:
  role_hook = p.get_role_hook(name)
  if role_hook:
   return role_hook(contents)
 return ':{0}:`{1}`'.format(name, contents)

def _plugin_replace_role ( name , contents , plugins ) : for p in plugins : role_hook = p . get_role_hook ( name ) if role_hook : return role_hook ( contents ) return ':{0}:`{1}`' . format ( name , contents )
the first plugin that handles this role is used .