def METHOD_NAME(self, parent, blocks):
    """Convert to details/summary block."""
    block = blocks.pop(0)
    m = self.START.search(block)
    if m:
        # remove the first line
        if m.start() > 0:
            self.parser.parseBlocks(parent, [block[:m.start()]])
        block = block[m.end():]
        block, non_details = self.detab(block)
    else:
        sibling, block, non_details = self.parse_content(parent, block)
    if m:
        state = m.group(1)
        is_open = state is not None
        if m.group(4):
            class_name = self.COMPRESS_SPACES.sub(' ', m.group(4).lower())
            title = class_name.split(' ')[0].capitalize()
        else:
            classes = m.group(2)
            class_name = '' if classes is None else self.COMPRESS_SPACES.sub(' ', classes.lower())
            title = m.group(3)
        div = etree.SubElement(parent, 'details', ({'open': 'open'} if is_open else {}))
        if class_name:
            div.set('class', class_name)
        summary = etree.SubElement(div, 'summary')
        summary.text = title
    else:
        # Sibling is a list item, but we need to wrap it's content should be wrapped in <p>
        if sibling.tag in ('li', 'dd') and sibling.text:
            text = sibling.text
            sibling.text = ''
            p = etree.SubElement(sibling, 'p')
            p.text = text
        div = sibling
    self.parser.parseChunk(div, block)
    if non_details:
        # Insert the non-details content back into blocks
        blocks.insert(0, non_details)