Repository: PHPOffice/PhpSpreadsheet (php)

Issue:
Add support for 
 tag when converting HTML to RichText
This is:

```
- [ ] a bug report
- [x] a feature request
- [x] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
```

### What is the expected behavior?

`
` tag should be interpreted as strikethrough text, similar to the `<del>` tag.

### What is the current behavior?

Text inside `
` tag is displayed as normal text.

### What are the steps to reproduce?

```php
<?php

require __DIR__.'vendor/autoload.php';

use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;

$spreadsheet = new Spreadsheet();
$activeWorksheet = $spreadsheet->getActiveSheet();
$input = 'Hello 
test
world';
$html = new Html();
$richText = $html->toRichTextObject($input);
$activeWorksheet->setCellValue('A1', $richText);

$writer = new Xlsx($spreadsheet);
$writer->save('hello_world.xlsx');
```

### What features do you think are causing the issue

- [ ] Reader
- [ ] Writer
- [ ] Styles
- [ ] Data Validations
- [ ] Formula Calculations
- [ ] Charts
- [ ] AutoFilter
- [ ] Form Elements

### Does an issue affect all spreadsheet file formats? If not, which formats are affected?

All formats affected

### Which versions of PhpSpreadsheet and PHP are affected?

All versions

Pull request:
Add support for 
 tag when converting HTML to RichText
This is:

- [ ] a bugfix
- [x] a new feature
- [ ] refactoring
- [ ] additional unit tests

Checklist:

- [x] Changes are covered by unit tests
  - [ ] Changes are covered by existing unit tests
  - [x] New unit tests have been added
- [x] Code style is respected
- [x] Commit message explains **why** the change is made (see https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
- [x] CHANGELOG.md contains a short summary of the change and a link to the pull request if applicable
- [ ] Documentation is updated as necessary

### Why this change is needed?

Fixes #4223 

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cd6c12ac0..fd987eae6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,7 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
 
 ### Fixed
 
-- Nothing yet.
+- Add support for `
` tag when converting HTML to RichText. [Issue #4223](https://github.com/PHPOffice/PhpSpreadsheet/issues/4223) [PR #4224](https://github.com/PHPOffice/PhpSpreadsheet/pull/4224)
 
 ## 2024-11-10 - 3.4.0
 
diff --git a/src/PhpSpreadsheet/Helper/Html.php b/src/PhpSpreadsheet/Helper/Html.php
index e690ae652..f9fc6e3dc 100644
--- a/src/PhpSpreadsheet/Helper/Html.php
+++ b/src/PhpSpreadsheet/Helper/Html.php
@@ -561,6 +561,7 @@ class Html
         'u' => [self::class, 'startUnderlineTag'],
         'ins' => [self::class, 'startUnderlineTag'],
         'del' => [self::class, 'startStrikethruTag'],
+        's' => [self::class, 'startStrikethruTag'],
         'sup' => [self::class, 'startSuperscriptTag'],
         'sub' => [self::class, 'startSubscriptTag'],
     ];
@@ -575,6 +576,7 @@ class Html
         'u' => [self::class, 'endUnderlineTag'],
         'ins' => [self::class, 'endUnderlineTag'],
         'del' => [self::class, 'endStrikethruTag'],
+        's' => [self::class, 'endStrikethruTag'],
         'sup' => [self::class, 'endSuperscriptTag'],
         'sub' => [self::class, 'endSubscriptTag'],
         'br' => [self::class, 'breakTag'],


Test patch:
diff --git a/tests/PhpSpreadsheetTests/Helper/HtmlTest.php b/tests/PhpSpreadsheetTests/Helper/HtmlTest.php
index 784eb4c55..26f22847a 100644
--- a/tests/PhpSpreadsheetTests/Helper/HtmlTest.php
+++ b/tests/PhpSpreadsheetTests/Helper/HtmlTest.php
@@ -48,4 +48,26 @@ class HtmlTest extends TestCase
 
         self::assertSame($expected, $actual->getPlainText());
     }
+
+    public function testSTag(): void
+    {
+        $html = new Html();
+        $input = 'Hello 
test
world';
+        $richText = $html->toRichTextObject($input);
+        $elements = $richText->getRichTextElements();
+
+        self::assertSame(count($elements), 3);
+
+        self::assertSame($elements[0]->getText(), 'Hello ');
+        self::assertNotNull($elements[0]->getFont());
+        self::assertFalse($elements[0]->getFont()->getStrikethrough());
+
+        self::assertSame($elements[1]->getText(), 'test');
+        self::assertNotNull($elements[1]->getFont());
+        self::assertTrue($elements[1]->getFont()->getStrikethrough());
+
+        self::assertSame($elements[2]->getText(), 'world');
+        self::assertNotNull($elements[2]->getFont());
+        self::assertFalse($elements[2]->getFont()->getStrikethrough());
+    }
 }