@@ -64,9 +64,15 @@ def parse(
6464 # note the only place this is normally called,
6565 # is by `RSTState.inline_text`, or in directives: `self.state.inline_text`,
6666 # and there the state parses its own parent
67- container = nodes .Element ()
68- with self ._renderer .current_node_context (container ):
69- self ._renderer .nested_render_text (text , lineno , inline = True )
67+ # self.reporter = memo.reporter
68+ # self.document = memo.document
69+ # self.language = memo.language
70+ with self ._renderer .current_node_context (parent ):
71+ # the parent is never actually appended to though,
72+ # so we make a temporary parent to parse into
73+ container = nodes .Element ()
74+ with self ._renderer .current_node_context (container ):
75+ self ._renderer .nested_render_text (text , lineno , inline = True )
7076
7177 return container .children , []
7278
@@ -188,12 +194,7 @@ def inline_text(
188194
189195 :returns: (list of nodes, list of messages)
190196 """
191- # in docutils this actually calls ``self.inliner.parse``
192- container = nodes .Element ()
193- with self ._renderer .current_node_context (container ):
194- self ._renderer .nested_render_text (text , lineno , inline = True )
195-
196- return container .children , []
197+ return self .inliner .parse (text , lineno , self .memo , self ._renderer .current_node )
197198
198199 # U+2014 is an em-dash:
199200 attribution_pattern = re .compile ("^((?:---?(?!-)|\u2014 ) *)(.+)" )
0 commit comments