class_docstr: A parser which converts Markdown to HTML.
  
  Attributes:
      Markdown.tab_length (int): The number of spaces which correspond to a single tab. Default: `4`.
      Markdown.ESCAPED_CHARS (list[str]): List of characters which get the backslash escape treatment.
      Markdown.block_level_elements (list[str]): List of HTML tags which get treated as block-level elements.
          See [`markdown.util.BLOCK_LEVEL_ELEMENTS`][] for the full list of elements.
      Markdown.registeredExtensions (list[Extension]): List of extensions which have called
          [`registerExtension`][markdown.Markdown.registerExtension] during setup.
      Markdown.doc_tag (str): Element used to wrap document. Default: `div`.
      Markdown.stripTopLevelTags (bool): Indicates whether the `doc_tag` should be removed. Default: 'True'.
      Markdown.references (dict[str, tuple[str, str]]): A mapping of link references found in a parsed document
           where the key is the reference name and the value is a tuple of the URL and title.
      Markdown.htmlStash (util.HtmlStash): The instance of the `HtmlStash` used by an instance of this class.
      Markdown.output_formats (dict[str, Callable[xml.etree.ElementTree.Element]]): A mapping of known output
           formats by name and their respective serializers. Each serializer must be a callable which accepts an
          [`Element`][xml.etree.ElementTree.Element] and returns a `str`.
      Markdown.output_format (str): The output format set by
          [`set_output_format`][markdown.Markdown.set_output_format].
      Markdown.serializer (Callable[xml.etree.ElementTree.Element]): The serializer set by
          [`set_output_format`][markdown.Markdown.set_output_format].
      Markdown.preprocessors (util.Registry): A collection of [`preprocessors`][markdown.preprocessors].
      Markdown.parser (blockparser.BlockParser): A collection of [`blockprocessors`][markdown.blockprocessors].
      Markdown.inlinePatterns (util.Registry): A collection of [`inlinepatterns`][markdown.inlinepatterns].
      Markdown.treeprocessors (util.Registry): A collection of [`treeprocessors`][markdown.treeprocessors].
      Markdown.postprocessors (util.Registry): A collection of [`postprocessors`][markdown.postprocessors].
class_docstr_tok: ["A","parser","which","converts","Markdown","to","HTML",".","Attributes",":","Markdown.tab_length","(","int",")",":","The","number","of","spaces","which","correspond","to","a","single","tab",".","Default",":","`","4","`",".","Markdown.ESCAPED_CHARS","(","list","[","str","]",")",":","List","of","characters","which","get","the","backslash","escape","treatment",".","Markdown.block_level_elements","(","list","[","str","]",")",":","List","of","HTML","tags","which","get","treated","as","block-level","elements",".","See","[","`","markdown.util.BLOCK_LEVEL_ELEMENTS","`","]","[","]","for","the","full","list","of","elements",".","Markdown.registeredExtensions","(","list","[","Extension","]",")",":","List","of","extensions","which","have","called","[","`","registerExtension","`","]","[","markdown.Markdown.registerExtension","]","during","setup",".","Markdown.doc_tag","(","str",")",":","Element","used","to","wrap","document",".","Default",":","`","div","`",".","Markdown.stripTopLevelTags","(","bool",")",":","Indicates","whether","the","`","doc_tag","`","should","be","removed",".","Default",":","'True","'",".","Markdown.references","(","dict","[","str",",","tuple","[","str",",","str","]","]",")",":","A","mapping","of","link","references","found","in","a","parsed","document","where","the","key","is","the","reference","name","and","the","value","is","a","tuple","of","the","URL","and","title",".","Markdown.htmlStash","(","util.HtmlStash",")",":","The","instance","of","the","`","HtmlStash","`","used","by","an","instance","of","this","class",".","Markdown.output_formats","(","dict","[","str",",","Callable","[","xml.etree.ElementTree.Element","]","]",")",":","A","mapping","of","known","output","formats","by","name","and","their","respective","serializers",".","Each","serializer","must","be","a","callable","which","accepts","an","[","`","Element","`","]","[","xml.etree.ElementTree.Element","]","and","returns","a","`","str","`",".","Markdown.output_format","(","str",")",":","The","output","format","set","by","[","`","set_output_format","`","]","[","markdown.Markdown.set_output_format","]",".","Markdown.serializer","(","Callable","[","xml.etree.ElementTree.Element","]",")",":","The","serializer","set","by","[","`","set_output_format","`","]","[","markdown.Markdown.set_output_format","]",".","Markdown.preprocessors","(","util.Registry",")",":","A","collection","of","[","`","preprocessors","`","]","[","markdown.preprocessors","]",".","Markdown.parser","(","blockparser.BlockParser",")",":","A","collection","of","[","`","blockprocessors","`","]","[","markdown.blockprocessors","]",".","Markdown.inlinePatterns","(","util.Registry",")",":","A","collection","of","[","`","inlinepatterns","`","]","[","markdown.inlinepatterns","]",".","Markdown.treeprocessors","(","util.Registry",")",":","A","collection","of","[","`","treeprocessors","`","]","[","markdown.treeprocessors","]",".","Markdown.postprocessors","(","util.Registry",")",":","A","collection","of","[","`","postprocessors","`","]","[","markdown.postprocessors","]","."]
docstr: Build extension from a string name, then return an instance using the given `configs`.
  
  Arguments:
      ext_name: Name of extension as a string.
      configs: Configuration settings for extension.
  
  Returns:
      An instance of the extension with the given configuration settings.
  
  First attempt to load an entry point. The string name must be registered as an entry point in the
  `markdown.extensions` group which points to a subclass of the [`markdown.extensions.Extension`][] class.
  If multiple distributions have registered the same name, the first one found is returned.
  
  If no entry point is found, assume dot notation (`path.to.module:ClassName`). Load the specified class and
  return an instance. If no class is specified, import the module and call a `makeExtension` function and return
  the [`markdown.extensions.Extension`][] instance returned by that function.
docstr_tok: ["Build","extension","from","a","string","name",",","then","return","an","instance","using","the","given","`","configs","`",".","Arguments",":","ext_name",":","Name","of","extension","as","a","string",".","configs",":","Configuration","settings","for","extension",".","Returns",":","An","instance","of","the","extension","with","the","given","configuration","settings",".","First","attempt","to","load","an","entry","point",".","The","string","name","must","be","registered","as","an","entry","point","in","the","`","markdown.extensions","`","group","which","points","to","a","subclass","of","the","[","`","markdown.extensions.Extension","`","]","[","]","class",".","If","multiple","distributions","have","registered","the","same","name",",","the","first","one","found","is","returned",".","If","no","entry","point","is","found",",","assume","dot","notation","(","`","path.to.module",":","ClassName","`",")",".","Load","the","specified","class","and","return","an","instance",".","If","no","class","is","specified",",","import","the","module","and","call","a","`","makeExtension","`","function","and","return","the","[","`","markdown.extensions.Extension","`","]","[","]","instance","returned","by","that","function","."]
code: def build_extension(
      self, ext_name: str, configs: Mapping[str, Any]
  ) -> Extension:
      """
      Build extension from a string name, then return an instance using the given `configs`.
  
      Arguments:
          ext_name: Name of extension as a string.
          configs: Configuration settings for extension.
  
      Returns:
          An instance of the extension with the given configuration settings.
  
      First attempt to load an entry point. The string name must be registered as an entry point in the
      `markdown.extensions` group which points to a subclass of the [`markdown.extensions.Extension`][] class.
      If multiple distributions have registered the same name, the first one found is returned.
  
      If no entry point is found, assume dot notation (`path.to.module:ClassName`). Load the specified class and
      return an instance. If no class is specified, import the module and call a `makeExtension` function and return
      the [`markdown.extensions.Extension`][] instance returned by that function.
      """
      configs = dict(configs)
  
      entry_points = [
          ep
          for ep in util.get_installed_extensions()
          if ep.name == ext_name
      ]
      if entry_points:
          ext = entry_points[0].load()
          return ext(**configs)
  
      # Get class name (if provided): `path.to.module:ClassName`
      ext_name, class_name = (
          ext_name.split(":", 1) if ":" in ext_name else (ext_name, "")
      )
  
      try:
          module = importlib.import_module(ext_name)
          logger.debug(
              'Successfully imported extension module "%s".' % ext_name
          )
      except ImportError as e:
          message = 'Failed loading extension "%s".' % ext_name
          e.args = (message,) + e.args[1:]
          raise
  
      if class_name:
          # Load given class name from module.
          return getattr(module, class_name)(**configs)
      else:
          # Expect  `makeExtension()` function to return a class.
          try:
              return module.makeExtension(**configs)
          except AttributeError as e:
              message = e.args[0]
              message = "Failed to initiate extension " "'%s': %s" % (
                  ext_name,
                  message,
              )
              e.args = (message,) + e.args[1:]
              raise
  
imports: from __future__ import annotations
  import codecs
  import sys
  import logging
  import importlib
  from typing import TYPE_CHECKING, Any, BinaryIO, Callable, ClassVar, Mapping, Sequence
  from .None import util
  from .preprocessors import build_preprocessors
  from .blockprocessors import build_block_parser
  from .treeprocessors import build_treeprocessors
  from .inlinepatterns import build_inlinepatterns
  from .postprocessors import build_postprocessors
  from .extensions import Extension
  from .serializers import to_html_string, to_xhtml_string
  from .util import BLOCK_LEVEL_ELEMENTS
label_desc: Use image node_id 4 for calling the Markdown obj's underlying member method code with example usage: obj.build_extension(ext_name, configs) and returns: ext, getattr, module