Skip to content

Decode percent-encoded data URI parameters - #2547

Open
Newman Gao (bozarnr) wants to merge 1 commit into
microsoft:mainfrom
bozarnr:audit/ingestion-edge-cases
Open

Newman Gao (bozarnr) wants to merge 1 commit into
microsoft:mainfrom
bozarnr:audit/ingestion-edge-cases

Conversation

@bozarnr

Copy link
Copy Markdown

Summary

  • decode percent-encoded data URI parameter values while parsing the media type metadata
  • cover percent-encoded charset values so downstream stream decoding receives the declared charset

Validation

  • direct regression check for data:text/plain;charset=utf%2D8,...
  • python -m py_compile packages/markitdown/src/markitdown/_uri_utils.py packages/markitdown/tests/test_module_misc.py
  • git diff --check

The existing base64-data URI work addresses escapes in the payload. This change covers the independent metadata parameter path consumed by MarkItDown.convert_uri().

Copilot AI lite review requested due to automatic review settings September 23, 2026 06:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified, and regression coverage is included.

Review effort: Lite
Findings: None

What changed in this PR

Updates data URI parsing to decode percent-encoded metadata parameters, including charset, before conversion.

Changes:

  • Decode parameter values with urllib.parse.unquote.
  • Add regression coverage for encoded charset and content values.
File Description
packages/​markitdown/​tests/​test_module_misc.py Tests percent-encoded data URI parsing.
packages/​markitdown/​src/​markitdown/​_uri_utils.py Decodes data URI parameter values.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants