TaskSystem/vendor/symfony/mime/HtmlToTextConverter/DefaultHtmlToTextConverter.php

24 lines
589 B
PHP
Raw Normal View History

2023-07-15 10:16:32 +08:00
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
2023-08-09 14:43:30 +08:00
namespace Symfony\Component\Mime\HtmlToTextConverter;
2023-07-15 10:16:32 +08:00
/**
* @author Fabien Potencier <fabien@symfony.com>
*/
2023-08-09 14:43:30 +08:00
class DefaultHtmlToTextConverter implements HtmlToTextConverterInterface
2023-07-15 10:16:32 +08:00
{
2023-08-09 14:43:30 +08:00
public function convert(string $html, string $charset): string
{
return strip_tags(preg_replace('{<(head|style)\b.*?</\1>}is', '', $html));
}
2023-07-15 10:16:32 +08:00
}