def _handle_code_block_within_text(self, text, code_block_pattern):
        """Handle the case where we find a code block within the text.
        If it's a complete code block, remove it and return surrounding text.
        If it's the start of a code block, return text before it and set state.
        """
        parts = re.split(code_block_pattern, text)
        if len(parts) > 2:
            return (parts[0] + " " + parts[-1]).strip()
        self._in_code_block = True
        return parts[0].strip()
Handle the case where we find a code block within the text.
        If it's a complete code block, remove it and return surrounding text.
        If it's the start of a code block, return text before it and set state.
        
src/pipecat/utils/text/markdown_text_filter.py