Skip to content

fix: normalize image reference paths to POSIX format#663

Open
sriharan0804 wants to merge 1 commit into
docling-project:mainfrom
sriharan0804:fix-windows-image-ref-paths
Open

fix: normalize image reference paths to POSIX format#663
sriharan0804 wants to merge 1 commit into
docling-project:mainfrom
sriharan0804:fix-windows-image-ref-paths

Conversation

@sriharan0804

Copy link
Copy Markdown
Contributor

Summary

This PR fixes Windows-specific image reference paths when exporting documents with referenced images.

Currently, image URIs are stored using the platform-specific path separator. On Windows this results in backslashes (\), which are URL-encoded as %5C in HTML output and also appear in Markdown image references.

This change normalizes the generated image URI to POSIX format using Path(...).as_posix(), ensuring consistent forward-slash (/) separators across platforms.

Changes

  • Normalize referenced image paths using Path(obj_path).as_posix().
  • Preserve cross-platform compatibility for HTML and Markdown image references.

Testing

  • Verified the implementation on Windows.
  • Confirmed that generated image references use / instead of \ (or %5C in HTML).
  • Ran formatting and lint checks locally.

Signed-off-by: sriharan2005@Tamil-- <sriharan0804@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

DCO Check Passed

Thanks @sriharan0804, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 Merge protection satisfied — ready to merge.

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant