Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
/*
4
 * This file is part of the Symfony package.
5
 *
6
 * (c) Fabien Potencier <fabien@symfony.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
 
12
namespace Symfony\Component\Mime\HtmlToTextConverter;
13
 
14
use League\HTMLToMarkdown\HtmlConverter;
15
use League\HTMLToMarkdown\HtmlConverterInterface;
16
 
17
/**
18
 * @author Fabien Potencier <fabien@symfony.com>
19
 */
20
class LeagueHtmlToMarkdownConverter implements HtmlToTextConverterInterface
21
{
22
    public function __construct(
23
        private HtmlConverterInterface $converter = new HtmlConverter([
24
            'hard_break' => true,
25
            'strip_tags' => true,
26
            'remove_nodes' => 'head style',
27
        ]),
28
    ) {
29
    }
30
 
31
    public function convert(string $html, string $charset): string
32
    {
33
        return $this->converter->convert($html);
34
    }
35
}