def _extract_rich_text_markdown(self, rich_text: List[dict]) -> str:
        """Extract rich text and convert to markdown formatting."""
        if not rich_text:
            return ""

        result_parts = []
        for text_obj in rich_text:
            text = text_obj.get("plain_text", "")
            if not text:
                continue

            annotations = text_obj.get("annotations", {})
            href = text_obj.get("href")

            # Apply formatting
            if annotations.get("bold"):
                text = f"**{text}**"
            if annotations.get("italic"):
                text = f"*{text}*"
            if annotations.get("strikethrough"):
                text = f"~~{text}~~"
            if annotations.get("underline"):
                text = f"<u>{text}</u>"
            if annotations.get("code"):
                text = f"`{text}`"

            # Handle links
            if href:
                text = f"[{text}]({href})"

            result_parts.append(text)

        return "".join(result_parts)
Extract rich text and convert to markdown formatting.
backend/airweave/platform/sources/notion.py