docs: def _filter_disabled_regions(contents):
      """Filter regions that are contained in back-ticks."""
      contents = list(contents)
  
      in_backticks = False
      contents_len = len(contents)
  
      index = 0
      while index < contents_len:
          character = contents[index]
          if character == "`":
              # Check to see if we should toggle the in_backticks
              # mode here by looking ahead for another two characters.
              if ((index + 2) < contents_len and
                      "".join(contents[index:index + 3]) == "```"):
                  in_backticks = not in_backticks
                  index += 3
                  continue
  
          if in_backticks:
              contents[index] = " "
  
          index += 1
  
      return "".join(contents)