unclecode/crawl4ai · error · AttributeError

The 'markdown_v2' attribute is deprecated and has been remov

Error message

The 'markdown_v2' attribute is deprecated and has been removed. Please use 'markdown' instead, which now returns a MarkdownGenerationResult, with
            following properties:
            - raw_markdown: The raw markdown string
            - markdown_with_citations: The markdown string with citations
            - references_markdown: The markdown string with references
            - fit_markdown: The markdown string with fit text
            

What it means

Error "The 'markdown_v2' attribute is deprecated and has been removed. Please use 'markdown' instead, which now returns a MarkdownGenerationResult, with following properties: - raw_markdown: The raw markdown string - markdown_with_citations: The markdown string with citations - references_markdown: The markdown string with references - fit_markdown: The markdown string with fit text " thrown in unclecode/crawl4ai.

Source

Thrown at crawl4ai/models.py:216

            return None
        return StringCompatibleMarkdown(self._markdown)
    
    @markdown.setter
    def markdown(self, value):
        """
        Setter for the markdown property.
        """
        self._markdown = value
    
    @property
    def markdown_v2(self):
        """
        Deprecated property that raises an AttributeError when accessed.

        This property exists to inform users that 'markdown_v2' has been
        deprecated and they should use 'markdown' instead.
        """
        raise AttributeError(
            "The 'markdown_v2' attribute is deprecated and has been removed. "
            """Please use 'markdown' instead, which now returns a MarkdownGenerationResult, with
            following properties:
            - raw_markdown: The raw markdown string
            - markdown_with_citations: The markdown string with citations
            - references_markdown: The markdown string with references
            - fit_markdown: The markdown string with fit text
            """
        )
    
    @property
    def fit_markdown(self):
        """
        Deprecated property that raises an AttributeError when accessed.
        """
        raise AttributeError(
            "The 'fit_markdown' attribute is deprecated and has been removed. "
            "Please use 'markdown.fit_markdown' instead."

View on GitHub (pinned to 7e80152142)

Solutions

  1. Access result.markdown instead of result.markdown_v2; use its properties such as raw_markdown or fit_markdown.
  2. Update code that consumed markdown_v2 to the MarkdownGenerationResult API.

Example fix

md = result.markdown.raw_markdown

When it happens

Trigger: Thrown at crawl4ai/models.py:216 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of unclecode/crawl4ai@7e80152142 (2026-08-14). Data as JSON: /api/errors/efc9fdd9d85b2686. Report an issue: GitHub.