Skip to content

Commit

Permalink
Add a test for the allow_task_list_markers options.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkende committed Mar 24, 2024
1 parent ada0a38 commit ec48a78
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions t/400-opt-allow_task_list_markers.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use strict;
use warnings;
use utf8;

use Markdown::Perl 'convert';
use Test2::V0;

my $cb = '<input disabled="" type="checkbox">';

is(convert("- [ ] foo\n\n [ ] bar", allow_task_list_markers => 'never'), "<ul>\n<li><p>[ ] foo</p>\n<p>[ ] bar</p>\n</li>\n</ul>\n", 'never');
is(convert("- [ ] foo\n\n [ ] bar", allow_task_list_markers => 'list'), "<ul>\n<li><p>${cb} foo</p>\n<p>[ ] bar</p>\n</li>\n</ul>\n", 'list');
is(convert("- [ ] foo\n\n [ ] bar", allow_task_list_markers => 'always'), "<ul>\n<li><p>${cb} foo</p>\n<p>${cb} bar</p>\n</li>\n</ul>\n", 'always');

done_testing;

0 comments on commit ec48a78

Please sign in to comment.