]> git.mxchange.org Git - friendica.git/blob - vendor/league/html-to-markdown/src/Converter/HardBreakConverter.php
Move HTML to Markdown library to Composer
[friendica.git] / vendor / league / html-to-markdown / src / Converter / HardBreakConverter.php
1 <?php
2
3 namespace League\HTMLToMarkdown\Converter;
4
5 use League\HTMLToMarkdown\Configuration;
6 use League\HTMLToMarkdown\ConfigurationAwareInterface;
7 use League\HTMLToMarkdown\ElementInterface;
8
9 class HardBreakConverter implements ConverterInterface, ConfigurationAwareInterface
10 {
11     /**
12      * @var Configuration
13      */
14     protected $config;
15
16     /**
17      * @param Configuration $config
18      */
19     public function setConfig(Configuration $config)
20     {
21         $this->config = $config;
22     }
23
24     /**
25      * @param ElementInterface $element
26      *
27      * @return string
28      */
29     public function convert(ElementInterface $element)
30     {
31         return $this->config->getOption('hard_break') ? "\n" : "  \n";
32     }
33
34     /**
35      * @return string[]
36      */
37     public function getSupportedTags()
38     {
39         return array('br');
40     }
41 }