import re


def ProcessGitHubLinks(markup, github):
  """Replaces the GitHub local links by the external variants."""
  markup = re.sub(
      r'#(\d+)',
      r'[#\1](https://github.com/%s/issues/\1)' % github,
      markup)
  markup = re.sub(
      r'\[(.+?)\]\((wiki/.+?)\)',
      r'[\1](https://github.com/%s/\2)' % github,
      markup)
  return markup