docs: def is_closing_code_fence(line: str,
                            fence: str,
                            is_document_end: bool = False,
                            parser: str = 'github') -> bool:
      r"""Determine if the given line is the end of a fenced code block.
  
      :parameter line: a single markdown line to evaluate.
      :paramter fence: a sequence of backticks or tildes marking the start of
           the current code block. This is usually the return value of the
           is_opening_code_fence function.
      :parameter is_document_end: This variable tells the function that the
           end of the file is reached.
           Defaults to ``False``.
      :parameter parser: decides rules on how to generate the anchor text.
           Defaults to ``github``.
      :type line: str
      :type fence: str
      :type is_document_end: bool
      :type parser: str
      :returns: True if the line ends the current code block. False otherwise.
      :rtype: bool
      :raises: a built-in exception.
      """
      if (parser == 'github' or parser == 'cmark' or parser == 'gitlab'
              or parser == 'commonmarker'):
          markers = md_parser['github']['code fence']['marker']
          marker_min_length = md_parser['github']['code fence'][
              'min_marker_characters']
  
          if not is_valid_code_fence_indent(line):
              return False
  
          # Remove opening fence indentation after it is known to be valid.
          fence = fence.lstrip(' ')
          # Check if fence uses valid characters.
          if not fence.startswith((markers[0], markers[1])):
              return False
  
          if len(fence) < marker_min_length:
              return False
  
          # Additional security.
          fence = fence.rstrip('\n').rstrip(' ')
          # Check that all fence characters are equal.
          if fence != len(fence) * fence[0]:
              return False
  
          # We might be inside a code block if this is not closed
          # by the end of the document, according to example 95 and 96.
          # This means that the end of the document corresponds to
          # a closing code fence.
          # Of course we first have to check that fence is a valid opening
          # code fence marker.
          # See:
          # https://github.github.com/gfm/#example-95
          # https://github.github.com/gfm/#example-96
          if is_document_end:
              return True
  
          # Check if line uses the same character as fence.
          line = line.lstrip(' ')
          if not line.startswith(fence):
              return False
  
          line = line.rstrip('\n').rstrip(' ')
          # Solves example 93 and 94. See:
          # https://github.github.com/gfm/#example-93
          # https://github.github.com/gfm/#example-94
          if len(line) < len(fence):
              return False
  
          # Closing fence must not have alien characters.
          if line != len(line) * line[0]:
              return False
  
          return True
      elif parser == 'redcarpet':
          # TODO.
          return False