becklyn/search-text-transformer
Converts HTML into clean, searchable plain text for indexing with search engines like Elasticsearch. Use SearchTextTransformer to strip tags and normalize content, making page text suitable for full‑text search and highlighting.
Transforms HTML to searchable plain text for usage in conjunction with a search engine (like Elasticsearch).
Install via composer.
<?php
use Becklyn\SearchText\SearchTextTransformer;
$transformer = new SearchTextTransformer();
$plain = $transformer->transform("<p>Some HTML content</p>");
All test cases belong into tests/fixtures and must have the file extension .test.
The test format is:
--TEST--
Here is a plain text description of this test.
--HTML--
<p>Some html.</p>
--EXPECT--
The expected result.
The --TEST-- segment is optional.
How can I help you explore Laravel packages today?