Skip to content

Allow conversion splitters for text extensions#1778

Merged
SimonCropp merged 3 commits into
mainfrom
Allow-conversion-splitters-for-text-extensions
Jul 8, 2026
Merged

Allow conversion splitters for text extensions#1778
SimonCropp merged 3 commits into
mainfrom
Allow-conversion-splitters-for-text-extensions

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

No description provided.

SimonCropp and others added 3 commits June 1, 2026 16:52
Allow conversion splitters for text extensions
Previously RegisterStreamConverter threw for text extensions, and the
splitter pipeline only handled stream targets, so a converter could not
run against a text extension (eg html).
- Drop the text-extension guard in RegisterStreamConverter
- DoExtensionConversion now takes the Target itself and resolves the
  converter input from either a stream or a text (utf8) target, instead
  of reconstructing an illegal stream Target for text extensions
- Scrub text targets before they are fed to a converter, so derived
  targets (eg rendered images) reflect the scrubbed content
- Move converted-target scrubbing into DoExtensionConversion and pass
  already-converted targets through GetTargets untouched, so each text
  target is scrubbed exactly once (no double scrub of the re-emitted
  source)
Add ExtensionConverterTests.TextSplitter covering a converter registered
against a text extension.
Conflict was in InnerVerifier_Inner.cs GetTargets, where both sides reworked
target conversion/scrubbing. Kept this branch's conversion-splitter rework
(inline Scrub, early return when doExtensionConversion is false, 2-arg
DoExtensionConversion) and applied main's cleanup-composition fix: Func<Task>
composed via .Then() rather than +=, which only awaits the last delegate. Also
converted the two += cleanups this branch newly added in InnerVerifier_Stream.cs
so stream/memory disposal is actually awaited.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@SimonCropp SimonCropp added this to the 31.22.0 milestone Jul 8, 2026
@SimonCropp SimonCropp merged commit 85799bb into main Jul 8, 2026
7 checks passed
@SimonCropp SimonCropp deleted the Allow-conversion-splitters-for-text-extensions branch July 8, 2026 21:22
This was referenced Jul 9, 2026
This was referenced Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant