Conversation
* docs: add TurboDocx Packages & SDKs section (#154) * docs: add TurboDocx Packages & SDKs section 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * docs: add badges and icons to Packages & SDKs table 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * docs: rename section to Explore the TurboDocx Ecosystem 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * chore: remove unmaintained CHANGELOG 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]> * fix: strike through not working --------- Co-authored-by: Nicolas <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: Nicolas Fry <[email protected]>
Signed-off-by: Kushal <[email protected]>
Signed-off-by: Kushal <[email protected]>
TurboDocx DOCX Diff Report
Summary
|
K-Kumar-01
left a comment
There was a problem hiding this comment.
Code Review: Strikethrough Support
Summary
This PR adds support for strikethrough text formatting using HTML tags (<del>, <s>, <strike>) and CSS (text-decoration: line-through). The implementation is clean and follows the existing patterns in the codebase.
Changes Reviewed
Core Implementation (src/helpers/xml-builder.js)
The implementation correctly adds cases for del, s, and strike tags in the buildRun function, setting tempAttributes.strike = true. This follows the same pattern as other inline formatting tags (bold, italic, underline, etc.).
Note: The CSS text-decoration: line-through support was already present in buildTextDecoration() (lines 285-289), so this PR correctly adds the missing HTML tag support.
Test Infrastructure
tests/helpers/docx-validator.js: Properly added strikethrough detection to extractstrikeproperty from run XMLtests/helpers/docx-assertions.js: AddedassertRunHasStrike()andassertRunNoStrike()helper functions with proper validation and error messages
Test Coverage (tests/strikethrough.test.js)
Comprehensive test suite covering:
- ✅ Basic strikethrough with all three HTML tags (
<del>,<s>,<strike>) - ✅ Mixed content (strikethrough + regular text)
- ✅ Combined formatting (strikethrough + bold, italic)
- ✅ Multiple strikethrough elements
- ✅ Edge cases (empty tags, whitespace, special characters, deep nesting)
- ✅ Complex structures (lists, tables, headings)
- ✅ CSS
text-decoration: line-through - ✅ Combined underline + strikethrough
Minor Observations
-
Typo in examples: The word "strikethrough" is misspelled as "strikethough" in the example files (example-node.js, App.js). This is cosmetic and doesn't affect functionality.
-
Whitespace changes: Several whitespace-only changes in
App.js(trailing spaces removed). These are fine but could be separated into a different commit for cleaner history. -
Unrelated additions in App.js: The PR includes SVG examples, nested lists, and table examples that aren't related to strikethrough. Consider splitting these into separate PRs for better reviewability.
Verdict
The core strikethrough implementation is solid, well-tested, and follows existing patterns. The test coverage is excellent. LGTM! ✅
Original Work: #157 by @stremlau