Skip to content

Commit

Permalink
Make strikethough_del the default behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
mtibben committed Apr 16, 2020
1 parent 7d78d00 commit 167bed3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/Html2Text.php
Expand Up @@ -229,8 +229,6 @@ class Html2Text
'width' => 70, // Maximum width of the formatted text, in columns.
// Set this value to 0 (or less) to ignore word wrapping
// and not constrain text to a fixed-width column.

'strikethough_del' => false, // use a combining character so that <del> appears struck-through.
);

private function legacyConstruct($html = '', $fromFile = false, array $options = array())
Expand Down Expand Up @@ -656,7 +654,7 @@ protected function strtoupper($str)
*/
protected function tostrike($str)
{
if (self::ENCODING != 'UTF-8' || $this->options['strikethough_del'] !== true) {
if (self::ENCODING != 'UTF-8') {
return $str;
}
$rtn = '';
Expand Down
2 changes: 1 addition & 1 deletion test/DelTest.php
Expand Up @@ -9,7 +9,7 @@ public function testDel()
$html = 'My <del>Résumé</del> Curriculum Vitæ';
$expected = 'My R̶é̶s̶u̶m̶é̶ Curriculum Vitæ';

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

0 comments on commit 167bed3

Please sign in to comment.