Skip to content

Commit

Permalink
Merge pull request #70 from ajouve/getHtml
Browse files Browse the repository at this point in the history
getHtml
  • Loading branch information
mtibben authored Jul 15, 2016
2 parents f55104b + 580a9ca commit cd71f2e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/Html2Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,16 @@ public function __construct($html = '', $options = array())
: ENT_COMPAT | ENT_HTML5;
}

/**
* Get the source HTML
*
* @return string
*/
public function getHtml()
{
return $this->html;
}

/**
* Set the source HTML
*
Expand Down
5 changes: 3 additions & 2 deletions test/BasicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public function basicDataProvider() {
*/
public function testBasic($html, $expected)
{
$html = new Html2Text($html);
$this->assertEquals($expected, $html->getText());
$html2Text = new Html2Text($html);
$this->assertEquals($expected, $html2Text->getText());
$this->assertEquals($html, $html2Text->getHtml());
}
}

0 comments on commit cd71f2e

Please sign in to comment.