You are here

public function PHPExcel_Helper_HTML::toRichTextObject in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Helper/HTML.php \PHPExcel_Helper_HTML::toRichTextObject()

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Helper/HTML.php, line 585

Class

PHPExcel_Helper_HTML

Code

public function toRichTextObject($html) {
  $this
    ->initialise();

  //	Create a new DOM object
  $dom = new domDocument();

  //	Load the HTML file into the DOM object
  //  Note the use of error suppression, because typically this will be an html fragment, so not fully valid markup
  $loaded = @$dom
    ->loadHTML($html);

  //	Discard excess white space
  $dom->preserveWhiteSpace = false;
  $this->richTextObject = new PHPExcel_RichText();
  $this
    ->parseElements($dom);
  return $this->richTextObject;
}