parameters: (self, lines)
return_statement: return lines
docstring: Search for nested fenced blocks.
docstring_summary: Search for nested fenced blocks.
docstring_tokens: Search for nested fenced blocks .
function: def search_nested(self, lines):
          """Search for nested fenced blocks."""
  
          count = 0
          for line in lines:
              if self.fence is None:
                  # Found the start of a fenced block.
                  m = self.fence_start.match(line)
                  if m is not None:
                      start = count
                      self.first = m.group(0)
                      self.ws = m.group('ws') if m.group('ws') else ''
                      self.ws_len = len(self.ws)
                      self.quote_level = self.ws.count(">")
                      self.empty_lines = 0
                      self.fence = m.group('fence')
                      self.lang = m.group('lang')
                      self.hl_lines = m.group('hl_lines')
                      self.linestart = m.group('linestart')
                      self.linestep = m.group('linestep')
                      self.linespecial = m.group('linespecial')
                      self.fence_end = re.compile(NESTED_FENCE_END % self.fence)
                      self.whitespace = re.compile(WS % self.ws_len)
              else:
                  # Evaluate lines
                  # - Determine if it is the ending line or content line
                  # - If is a content line, make sure it is all indentend
                  #   with the opening and closing lines (lines with just
                  #   whitespace will be stripped so those don't matter).
                  # - When content lines are inside blockquotes, make sure
                  #   the nested block quote levels make sense according to
                  #   blockquote rules.
                  m = self.whitespace.match(line)
                  if m:
                      end = count + 1
                      quote_level = m.group(1).count(">")
  
                      if self.quote_level:
                          # Handle blockquotes
                          self.eval_quoted(m, quote_level, start, end)
                      elif quote_level == 0:
                          # Handle all other cases
                          self.eval(m, start, end)
                      else:
                          # Looks like we got a blockquote line
                          # when not in a blockquote.
                          self.clear()
                  else:  # pragma: no cover
                      # I am 99.9999% sure we will never hit this line.
                      # But I am too chicken to pull it out :).
                      self.clear()
              count += 1
  
          # Now that we are done iterating the lines,
          # let's replace the original content with the
          # fenced blocks.
          while len(self.stack):
              fenced, start, end = self.stack.pop()
              lines = lines[:start] + [fenced] + lines[end:]
          return lines
function_tokens: def search_nested ( self , lines ) : count = 0 for line in lines : if self . fence is None : # Found the start of a fenced block. m = self . fence_start . match ( line ) if m is not None : start = count self . first = m . group ( 0 ) self . ws = m . group ( 'ws' ) if m . group ( 'ws' ) else '' self . ws_len = len ( self . ws ) self . quote_level = self . ws . count ( ">" ) self . empty_lines = 0 self . fence = m . group ( 'fence' ) self . lang = m . group ( 'lang' ) self . hl_lines = m . group ( 'hl_lines' ) self . linestart = m . group ( 'linestart' ) self . linestep = m . group ( 'linestep' ) self . linespecial = m . group ( 'linespecial' ) self . fence_end = re . compile ( NESTED_FENCE_END % self . fence ) self . whitespace = re . compile ( WS % self . ws_len ) else : # Evaluate lines # - Determine if it is the ending line or content line # - If is a content line, make sure it is all indentend #   with the opening and closing lines (lines with just #   whitespace will be stripped so those don't matter). # - When content lines are inside blockquotes, make sure #   the nested block quote levels make sense according to #   blockquote rules. m = self . whitespace . match ( line ) if m : end = count + 1 quote_level = m . group ( 1 ) . count ( ">" ) if self . quote_level : # Handle blockquotes self . eval_quoted ( m , quote_level , start , end ) elif quote_level == 0 : # Handle all other cases self . eval ( m , start , end ) else : # Looks like we got a blockquote line # when not in a blockquote. self . clear ( ) else : # pragma: no cover # I am 99.9999% sure we will never hit this line. # But I am too chicken to pull it out :). self . clear ( ) count += 1 # Now that we are done iterating the lines, # let's replace the original content with the # fenced blocks. while len ( self . stack ) : fenced , start , end = self . stack . pop ( ) lines = lines [ : start ] + [ fenced ] + lines [ end : ] return lines