<?php
declare(strict_types=1);
namespace Butschster\ContextGenerator\Lib\Html;
use League\HTMLToMarkdown\HtmlConverter;
/**
* HTML content cleaner for URL sources
*/
final readonly class HtmlCleaner implements HtmlCleanerInterface
{
public function __construct(
private HtmlConverter $htmlConverter = new HtmlConverter(),
) {
$this->htmlConverter->getConfig()->setOption('strip_tags', true);
}
public function clean(string $html): string
{
if ($html === '') {
return '';
}
return $this->htmlConverter->convert($html);
}
}
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/context-hub/generator'
If you have feedback or need assistance with the MCP directory API, please join our Discord server