code: def _remove_double_brackets(text):
    
    def replacement_fn(s):
      if u":" in s:
        # this is probably a category or something like that.
        return ""
      # keep the part after the bar.
      bar_pos = s.find(u"|")
      if bar_pos == -1:
        return s
      return s[bar_pos + 1:]
    return _find_and_replace(text, u"[[", u"]]", replacement_fn)
docs: Remove double brackets (internal links) but leave the viewable text.
  
    Args:
      text: a unicode string
    Returns:
      a unicode string