def nested_parse_with_titles(state, content, node):
 surrounding_title_styles = state.memo.title_styles
 surrounding_section_level = state.memo.section_level
 state.memo.title_styles = []
 state.memo.section_level = 0
 try:
  return state.nested_parse(content, 0, node, match_titles=1)
 finally:
  state.memo.title_styles = surrounding_title_styles
  state.memo.section_level = surrounding_section_level

def nested_parse_with_titles ( state , content , node ) : surrounding_title_styles = state . memo . title_styles surrounding_section_level = state . memo . section_level state . memo . title_styles = [ ] state . memo . section_level = 0 try : return state . nested_parse ( content , 0 , node , match_titles = 1 ) finally : state . memo . title_styles = surrounding_title_styles state . memo . section_level = surrounding_section_level
version of state .