You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Image links not extracted correctly, resulting in empty ![]() in Markdown output #1177
When using markitdown to convert a WeChat article to Markdown, the image URLs are not being extracted properly. The resulting Markdown output contains image tags like ![]() with empty URLs, causing the images to be missing from the final content.
Additional Notes
It seems that the indicates the Markdown syntax is being applied, but the image URLs are missing. This may be caused by changes in the structure of WeChat article pages, or possibly a case that isn’t currently supported.
Would appreciate any help or fix for this — thanks for the great tool!
I reviewed the URL you provided and found that some images on the webpage are embedded using the data-src attribute instead of the standard src. For example:
The HTML parsing library is a customized version based on markdownify. Its default convert_img function only processes the src attribute. As a result, images that use the data-src attribute are not parsed correctly.
To address this issue, considering the highly dynamic nature of HTML content, it may be necessary to implement a custom parsing function to support such cases.
Temporary Workaround
A monkey patch can be applied to replace the convert_img function to support data-src. However, this is only a temporary solution.
Activity
WangYuhang-CN commentedon Apr 11, 2025
I reviewed the URL you provided and found that some images on the webpage are embedded using the data-src attribute instead of the standard src. For example:
The HTML parsing library is a customized version based on
markdownify. Its defaultconvert_imgfunction only processes thesrc attribute. As a result, images that use thedata-src attributeare not parsed correctly.To address this issue, considering the highly dynamic nature of HTML content, it may be necessary to implement a custom parsing function to support such cases.
Temporary Workaround
A monkey patch can be applied to replace the
convert_imgfunction to supportdata-src. However, this is only a temporary solution.Code:
Core Logic
When the
srcattribute is not present, fallback to thedata-srcattribute to retrieve the image URL.KevinChen1994 commentedon Apr 21, 2025
Thanks a lot, it helps!