Text::Markdown::Discount
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.

28 lines
549 B

  1. use strict;
  2. use warnings;
  3. use utf8;
  4. use Test::More tests => 3;
  5. use Text::Markdown::Discount qw/markdown/;
  6. my $html = '<article>abc</article>';
  7. {
  8. is trim(markdown($html)), '<p><article>abc</article></p>';
  9. }
  10. Text::Markdown::Discount::with_html5_tags();
  11. {
  12. my $md = Text::Markdown::Discount->new();
  13. is trim(markdown($html)), '<article>abc</article>';
  14. }
  15. {
  16. is trim(Text::Markdown::Discount::markdown($html)), '<article>abc</article>';
  17. }
  18. sub trim {
  19. my $text = shift;
  20. $text =~ s/\A\s+//ms;
  21. $text =~ s/\s+$//ms;
  22. $text;
  23. }