class_docstr: Process Markdown Inside HTML Blocks which have been stored in the `HtmlStash`.
docstr: Recursively parse the text content of an `etree` Element as Markdown.
  
  Any block level elements generated from the Markdown will be inserted as children of the element in place
  of the text content. All `markdown` attributes are removed. For any elements in which Markdown parsing has
  been disabled, the text content of it and its children are wrapped in an `AtomicString`.
code: def parse_element_content(self, element: etree.Element) -> None:
      """
      Recursively parse the text content of an `etree` Element as Markdown.
  
      Any block level elements generated from the Markdown will be inserted as children of the element in place
      of the text content. All `markdown` attributes are removed. For any elements in which Markdown parsing has
      been disabled, the text content of it and its children are wrapped in an `AtomicString`.
      """
  
      md_attr = element.attrib.pop("markdown", "off")
  
      if md_attr == "block":
          # Parse content as block level
          # The order in which the different parts are parsed (text, children, tails) is important here as the
          # order of elements needs to be preserved. We can't be inserting items at a later point in the current
          # iteration as we don't want to do raw processing on elements created from parsing Markdown text (for
          # example). Therefore, the order of operations is children, tails, text.
  
          # Recursively parse existing children from raw HTML
          for child in list(element):
              self.parse_element_content(child)
  
          # Parse Markdown text in tail of children. Do this separate to avoid raw HTML parsing.
          # Save the position of each item to be inserted later in reverse.
          tails = []
          for pos, child in enumerate(element):
              if child.tail:
                  block = child.tail.rstrip("\n")
                  child.tail = ""
                  # Use a dummy placeholder element.
                  dummy = etree.Element("div")
                  self.parser.parseBlocks(dummy, block.split("\n\n"))
                  children = list(dummy)
                  children.reverse()
                  tails.append((pos + 1, children))
  
          # Insert the elements created from the tails in reverse.
          tails.reverse()
          for pos, tail in tails:
              for item in tail:
                  element.insert(pos, item)
  
          # Parse Markdown text content. Do this last to avoid raw HTML parsing.
          if element.text:
              block = element.text.rstrip("\n")
              element.text = ""
              # Use a dummy placeholder element as the content needs to get inserted before existing children.
              dummy = etree.Element("div")
              self.parser.parseBlocks(dummy, block.split("\n\n"))
              children = list(dummy)
              children.reverse()
              for child in children:
                  element.insert(0, child)
  
      elif md_attr == "span":
          # Span level parsing will be handled by inline processors.
          # Walk children here to remove any `markdown` attributes.
          for child in list(element):
              self.parse_element_content(child)
  
      else:
          # Disable inline parsing for everything else
          if element.text is None:
              element.text = ""
          element.text = util.AtomicString(element.text)
          for child in list(element):
              self.parse_element_content(child)
              if child.tail:
                  child.tail = util.AtomicString(child.tail)
  
imports: from __future__ import annotations
  from .None import Extension
  from ..blockprocessors import BlockProcessor
  from ..preprocessors import Preprocessor
  from ..postprocessors import RawHtmlPostprocessor
  from ..None import util
  from ..htmlparser import HTMLExtractor, blank_line_re
  import xml.etree.ElementTree
  from typing import TYPE_CHECKING, Literal, Mapping
label_desc: Use image node_id 2 for calling the MarkdownInHtmlProcessor obj's underlying member method code with example usage: obj.parse_element_content(element) without return types