File: 13.html5.t

package info (click to toggle)
libtext-markdown-discount-perl 0.18-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,524 kB
  • sloc: ansic: 5,765; pascal: 1,027; sh: 208; makefile: 196; perl: 184
file content (28 lines) | stat: -rw-r--r-- 549 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use strict;
use warnings;
use utf8;
use Test::More tests => 3;
use Text::Markdown::Discount qw/markdown/;

my $html = '<article>abc</article>';
{
    is trim(markdown($html)), '<p><article>abc</article></p>';
}

Text::Markdown::Discount::with_html5_tags();

{
    my $md = Text::Markdown::Discount->new();
    is trim(markdown($html)), '<article>abc</article>';
}

{
    is trim(Text::Markdown::Discount::markdown($html)), '<article>abc</article>';
}

sub trim {
    my $text = shift;
    $text =~ s/\A\s+//ms;
    $text =~ s/\s+$//ms;
    $text;
}