3 namespace League\HTMLToMarkdown\Converter;
5 use League\HTMLToMarkdown\ElementInterface;
7 class BlockquoteConverter implements ConverterInterface
10 * @param ElementInterface $element
14 public function convert(ElementInterface $element)
16 // Contents should have already been converted to Markdown by this point,
17 // so we just need to add '>' symbols to each line.
21 $quote_content = trim($element->getValue());
23 $lines = preg_split('/\r\n|\r|\n/', $quote_content);
25 $total_lines = count($lines);
27 foreach ($lines as $i => $line) {
28 $markdown .= '> ' . $line . "\n";
29 if ($i + 1 === $total_lines) {
40 public function getSupportedTags()
42 return array('blockquote');