Skip to content

Commit

Permalink
Merge pull request #45 from asimlqt/striptags
Browse files Browse the repository at this point in the history
Replaced html to text with standard strip_tags function
  • Loading branch information
asimlqt authored Jul 10, 2018
2 parents ac88e18 + ed43896 commit e9d6a28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
namespace Byng\Pimcore\Elasticsearch\Processor\Element;

use Byng\Pimcore\Elasticsearch\Processor\ProcessorException;
use NF\HtmlToText;
use Pimcore\Model\Document\Tag;

/**
Expand All @@ -25,22 +24,6 @@
*/
final class ElementProcessor
{
/**
* @var HtmlToText
*/
private $htmlToTextFilter;


/**
* Constructor
*
* @param HtmlToText $htmlToTextFilter
*/
public function __construct(HtmlToText $htmlToTextFilter)
{
$this->htmlToTextFilter = $htmlToTextFilter;
}

/**
* Process a generic element
*
Expand All @@ -60,7 +43,6 @@ public function processElement(Tag $tag)
);
}

// This needs to be handled much more elegantly than with the error suppression operator
return @$this->htmlToTextFilter->convert($elementData);
return strip_tags($elementData);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Byng\Pimcore\Elasticsearch\Processor\Element\DateElementProcessor;
use Byng\Pimcore\Elasticsearch\Processor\Element\ElementProcessor;
use Byng\Pimcore\Elasticsearch\Processor\Element\SelectElementProcessor;
use NF\HtmlToText;

/**
* PageProcessor Factory
Expand All @@ -37,7 +36,7 @@ final class PageProcessorFactory
*/
public function build(FilterInterface $filter = null)
{
$elementProcessor = new ElementProcessor(new HtmlToText());
$elementProcessor = new ElementProcessor();

return new PageProcessor(
$elementProcessor,
Expand Down

0 comments on commit e9d6a28

Please sign in to comment.