Skip to content

Commit 167bed3

Browse files
committed
Make strikethough_del the default behaviour
1 parent 7d78d00 commit 167bed3

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/Html2Text.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,6 @@ class Html2Text
229229
'width' => 70, // Maximum width of the formatted text, in columns.
230230
// Set this value to 0 (or less) to ignore word wrapping
231231
// and not constrain text to a fixed-width column.
232-
233-
'strikethough_del' => false, // use a combining character so that <del> appears struck-through.
234232
);
235233

236234
private function legacyConstruct($html = '', $fromFile = false, array $options = array())
@@ -656,7 +654,7 @@ protected function strtoupper($str)
656654
*/
657655
protected function tostrike($str)
658656
{
659-
if (self::ENCODING != 'UTF-8' || $this->options['strikethough_del'] !== true) {
657+
if (self::ENCODING != 'UTF-8') {
660658
return $str;
661659
}
662660
$rtn = '';

test/DelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public function testDel()
99
$html = 'My <del>Résumé</del> Curriculum Vitæ';
1010
$expected = 'My R̶é̶s̶u̶m̶é̶ Curriculum Vitæ';
1111

12-
$html2text = new Html2Text($html, array('strikethough_del' => true));
12+
$html2text = new Html2Text($html);
1313
$this->assertEquals($expected, $html2text->getText());
1414
}
1515
}

0 commit comments

Comments
 (0)