Skip to content

Strikethrough support#184

Open
K-Kumar-01 wants to merge 3 commits intodevelopfrom
strikethrough-support
Open

Strikethrough support#184
K-Kumar-01 wants to merge 3 commits intodevelopfrom
strikethrough-support

Conversation

@K-Kumar-01
Copy link
Collaborator

Original Work: #157 by @stremlau

stremlau and others added 3 commits February 17, 2026 06:30
* 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]>
@github-actions
Copy link

TurboDocx DOCX Diff Report

Automated HTML to DOCX regression testing | Powered by TurboDocx

Summary

  • ✅ Identical files: 67
  • 🔄 Changed files: 1
  • ➕ New files: 0
  • ➖ Deleted files: 0

⚠️ Changes Requiring Manual Review

word/document.xml

  • Type: content_change
  • Description: New paragraphs or content added - verify test case changes

📝 Detailed Changes

word/document.xml

  • Category: content_change
  • Severity: warn
  • Description: New paragraphs or content added - verify test case changes

🔍 OOXML Content Diff

Expand each section to see the actual OOXML changes

word/document.xml - New paragraphs or content added - verify test case changes
  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <w:document xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:cdr="http://schemas.openxmlformats.org/drawingml/2006/chartDrawing" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml">
    <w:body>
  ...
-         <w:rPr/>
+         <w:rPr>
+           <w:strike w:val="true"/>
+         </w:rPr>
          </w:t>
  ...
-         <w:rPr/>
+         <w:rPr>
+           <w:strike w:val="true"/>
+         </w:rPr>
  ...
-         <w:rPr/>
+         <w:rPr>
+           <w:strike w:val="true"/>
+         </w:rPr>
  ...
-         <w:rPr/>
+         <w:rPr>
+           <w:strike w:val="true"/>
+         </w:rPr>
          </w:t>
  ...
-         <w:rPr/>
+         <w:rPr>
+           <w:strike w:val="true"/>
+         </w:rPr>
  ...
-         <w:rPr/>
+         <w:rPr>
+           <w:strike w:val="true"/>
+         </w:rPr>
  ...
-         <w:rPr/>
+         <w:rPr>
+           <w:strike w:val="true"/>
+         </w:rPr>
          </w:t>
  ...
-         <w:rPr/>
+         <w:rPr>
+           <w:strike w:val="true"/>
+         </w:rPr>
  ...
-         <w:rPr/>
+         <w:rPr>
+           <w:strike w:val="true"/>

... [Diff truncated - download artifact for full diff]

🚀 Powered by TurboDocx | html-to-docx

Automated DOCX regression testing • Catch document generation bugs before they ship • 100% open source

Generated by TurboDocx DOCX Diff workflow • Learn more

Copy link
Collaborator Author

@K-Kumar-01 K-Kumar-01 left a comment

Choose a reason for hiding this comment

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

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 extract strike property from run XML
  • tests/helpers/docx-assertions.js: Added assertRunHasStrike() and assertRunNoStrike() 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

  1. 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.

  2. 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.

  3. 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! ✅

@K-Kumar-01 K-Kumar-01 changed the base branch from main to develop February 17, 2026 17:03
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