@@ -192,7 +192,6 @@ def render_nb_cell_code(self: SelfType, token: SyntaxTreeNode) -> None:
192192
193193 self .add_line_and_source_path (cell_container , token )
194194 with self .current_node_context (cell_container , append = True ):
195-
196195 # render the code source code
197196 if not remove_input :
198197 cell_input = nodes .container (
@@ -311,11 +310,6 @@ class MimeData:
311310 """Index of the output in the cell"""
312311 line : int | None = None
313312 """Source line of the cell"""
314- md_headings : bool = False
315- """Whether to render headings in text/markdown blocks."""
316- # we can only do this if know the content will be rendered into the main body
317- # of the document, e.g. not inside a container node
318- # (otherwise it will break the structure of the AST)
319313
320314 @property
321315 def string (self ) -> str :
@@ -599,9 +593,7 @@ def render_markdown(self, data: MimeData) -> list[nodes.Element]:
599593 fmt = self .renderer .get_cell_level_config (
600594 "render_markdown_format" , data .cell_metadata , line = data .line
601595 )
602- return self ._render_markdown_base (
603- data , fmt = fmt , inline = False , allow_headings = data .md_headings
604- )
596+ return self ._render_markdown_base (data , fmt = fmt , inline = False )
605597
606598 def render_text_plain (self , data : MimeData ) -> list [nodes .Element ]:
607599 """Render a notebook text/plain mime data output."""
@@ -754,9 +746,7 @@ def render_markdown_inline(self, data: MimeData) -> list[nodes.Element]:
754746 fmt = self .renderer .get_cell_level_config (
755747 "render_markdown_format" , data .cell_metadata , line = data .line
756748 )
757- return self ._render_markdown_base (
758- data , fmt = fmt , inline = True , allow_headings = data .md_headings
759- )
749+ return self ._render_markdown_base (data , fmt = fmt , inline = True )
760750
761751 def render_text_plain_inline (self , data : MimeData ) -> list [nodes .Element ]:
762752 """Render a notebook text/plain mime data output."""
@@ -797,7 +787,7 @@ def render_widget_view_inline(self, data: MimeData) -> list[nodes.Element]:
797787 return self .render_widget_view (data )
798788
799789 def _render_markdown_base (
800- self , data : MimeData , * , fmt : str , inline : bool , allow_headings : bool
790+ self , data : MimeData , * , fmt : str , inline : bool
801791 ) -> list [nodes .Element ]:
802792 """Base render for a notebook markdown mime output (block or inline)."""
803793 psuedo_element = nodes .Element () # element to hold the parsed markdown
@@ -833,7 +823,6 @@ def _render_markdown_base(
833823 data .string ,
834824 data .line or 0 ,
835825 inline = inline ,
836- allow_headings = allow_headings ,
837826 )
838827 finally :
839828 # restore the parser
0 commit comments