unclecode/crawl4ai · error · AttributeError
The 'fit_markdown' attribute is deprecated and has been remo
Error message
The 'fit_markdown' attribute is deprecated and has been removed. Please use 'markdown.fit_markdown' instead.
What it means
Error "The 'fit_markdown' attribute is deprecated and has been removed. Please use 'markdown.fit_markdown' instead." thrown in unclecode/crawl4ai.
Source
Thrown at crawl4ai/models.py:232
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."
)
@property
def fit_html(self):
"""
Deprecated property that raises an AttributeError when accessed.
"""
raise AttributeError(
"The 'fit_html' attribute is deprecated and has been removed. "
"Please use 'markdown.fit_html' instead."
)
def model_dump(self, *args, **kwargs):
"""
Override model_dump to include the _markdown private attribute in serialization.
View on GitHub (pinned to 7e80152142)
Solutions
- Use result.markdown.fit_markdown instead of the removed fit_markdown attribute.
Example fix
fit = result.markdown.fit_markdown
When it happens
Trigger: Thrown at crawl4ai/models.py:232 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/b990dacde7a65377.
Report an issue: GitHub.