nextcloud-mail2deck/lib/ConvertToMD.php

24 wiersze
446 B
PHP

2022-04-13 10:31:54 +00:00
<?php
namespace Mail2Deck;
2022-04-13 10:31:54 +00:00
use League\HTMLToMarkdown\HtmlConverter;
class ConvertToMD {
protected $html;
2024-12-03 15:11:11 +00:00
protected $converter;
2022-04-13 10:31:54 +00:00
public function __construct($html) {
$this->converter = new HtmlConverter([
'strip_tags' => true,
'remove_nodes' => 'title'
]);
$this->html = $html;
}
public function execute()
{
return $this->converter->convert($this->html);
}
}