[Clippy] feat(html): render DOCX text boxes as inline-block divs in WmlToHtmlConverter#166
Draft
github-actions[bot] wants to merge 1 commit intomasterfrom
Draft
Conversation
…onverter Previously, w:drawing elements containing a wps:wsp text box (wps:txbx) were silently dropped by the HTML converter because ProcessDrawing only handled blipFill (image) drawings. This adds ProcessTextBoxDrawing which: - Detects wps:wsp/wps:txbx in both wp:anchor (floating) and wp:inline drawings - Extracts w:txbxContent paragraphs and recursively transforms them via the existing HTML conversion pipeline - Emits a <div> with display:inline-block, width/min-height from wp:extent, and float:left for anchored (floating) text boxes Fixes: #65 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Mar 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Clippy, an automated AI assistant.
Closes #65
Summary
Text boxes in DOCX (
w:drawingcontainingwps:wsp/wps:txbx) were silently dropped byWmlToHtmlConverter. The converter'sProcessDrawingmethod returnednullfor any drawing that wasn't an image (noa:blipFill), so all text box content was lost in HTML output.Root Cause
ProcessDrawingonly handled the image path (Pic.blipFill). There was no code path forwps:wsp/wps:txbxshapes that contain text content.Fix
Added
ProcessTextBoxDrawingcalled fromConvertToHtmlTransformbefore the existingProcessImagecall:a:graphicData/wps:wsp/wps:txbxin bothwp:anchor(floating) andwp:inlinecontainers.w:txbxContentparagraphs through the existing recursive HTML transform pipeline — all paragraph formatting, runs, hyperlinks, nested tables, etc. are handled correctly.wp:extent cx/cy(in EMUs) to setwidthandmin-heightCSS properties.wp:anchor(floating) text boxes getfloat: leftso surrounding body text flows around them.Emitted HTML
✅ All 1207 tests pass.
dotnet csharpier check .passes.