Skip to content

Fix Document.isText() media type handling and add test coverage#5892

Open
karansahani78 wants to merge 1 commit intospring-projects:mainfrom
karansahani78:fix/document-istext-5600
Open

Fix Document.isText() media type handling and add test coverage#5892
karansahani78 wants to merge 1 commit intospring-projects:mainfrom
karansahani78:fix/document-istext-5600

Conversation

@karansahani78
Copy link
Copy Markdown

Improve handling of media types in Document.isText()

Previously, certain text-based media types were not correctly identified as text.
This change improves the detection logic to properly handle such cases.

Additionally, a new test class (DocumentIsTextMediaTest) has been added to
verify correct behavior across different media types.

  • Fix media type detection in Document.isText()
  • Add test coverage for text and non-text media types

Signed-off-by: karansahani78 <119734907+karansahani78@users.noreply.github.com>
@karansahani78 karansahani78 force-pushed the fix/document-istext-5600 branch from 9d80b57 to d9902d1 Compare April 27, 2026 05:35
@karansahani78
Copy link
Copy Markdown
Author

This PR is related to #5600.

Based on the ongoing discussion there, it seems introducing a clearer distinction for “textual media” may be preferred over modifying isText() directly.

I’m keeping this PR as a reference for the current approach, but I’m happy to refactor it (e.g. introduce a helper like isTextualMedia() or adjust toward a formatter-based solution) once the direction is confirmed.

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