def _process_non_code_blocks(self, text: str, handlers: list[Callable[[str], str]]) -> str:
        """
        Allows to process Markdown documents with passed callbacks. Callbacks are only
        executed outside code blocks.
        """

        used_quotes = ""
        block_start_pos = 0
        inside_code_block = False
        while block_start_pos < len(text):
            pattern = re.compile(used_quotes or "```|`")
            next_code_block_quote = pattern.search(text, pos=block_start_pos)
            if next_code_block_quote is not None:
                if not used_quotes:
                    inside_code_block = False
                    block_end_pos = next_code_block_quote.start(0)
                    used_quotes = next_code_block_quote.group(0)
                else:
                    inside_code_block = True
                    block_end_pos = next_code_block_quote.end(0)
                    used_quotes = None
            else:
                block_end_pos = len(text)

            if not inside_code_block:
                block = text[block_start_pos:block_end_pos]

                for handler in handlers:
                    block = handler(block)

                text = text[:block_start_pos] + block + text[block_end_pos:]
                block_end_pos = block_start_pos + len(block) + len(used_quotes)

            block_start_pos = block_end_pos

        return text

        Allows to process Markdown documents with passed callbacks. Callbacks are only
        executed outside code blocks.
        
site/process_sdk_docs.py