docling-project / docling-project/docling-core

Image Markdown issue

Open
#196 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
282
Forks
214
Avg merge
2d 15h
Merged PRs (30d)
21

Description

doc_core/doc/types/document.py Line 963. Seems like it is creating an issue.
`def export_to_markdown(
self,
doc: "DoclingDocument",
add_caption: bool = True, # deprecated
image_mode: ImageRefMode = ImageRefMode.EMBEDDED,
image_placeholder: str = "",
) -> str:
"""Export picture to Markdown format."""
from docling_core.experimental.serializer.markdown import MarkdownDocSerializer

if not add_caption:
_logger.warning(
"Argument `add_caption` is deprecated and will be ignored.",
)

serializer = MarkdownDocSerializer(
doc=self, ----> This probably should be doc but not sure
image_mode=image_mode,
)
text = (
serializer.picture_serializer.serialize(
item=self,
doc_serializer=serializer,
doc=doc,
image_mode=image_mode,
image_placeholder=image_placeholder,
).text
if serializer.picture_serializer
else ""
)
return text`

This method is throwing pydantic validation error. Due the first variable passed to MDSerializer should be DoclingDocument

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.