Copie de Tumblr sur Shaarli
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
532B

  1. <?php
  2. namespace League\HTMLToMarkdown\Converter;
  3. use League\HTMLToMarkdown\ElementInterface;
  4. class ParagraphConverter implements ConverterInterface
  5. {
  6. /**
  7. * @param ElementInterface $element
  8. *
  9. * @return string
  10. */
  11. public function convert(ElementInterface $element)
  12. {
  13. $value = $element->getValue();
  14. return trim($value) !== '' ? rtrim($value) . "\n\n" : '';
  15. }
  16. /**
  17. * @return string[]
  18. */
  19. public function getSupportedTags()
  20. {
  21. return array('p');
  22. }
  23. }