@@ -22,6 +22,58 @@ fn tasklist() {
2222 " * [x] Green\n " ,
2323 " * [ ] Blue\n "
2424 ) ,
25+ concat!(
26+ "<ul>\n " ,
27+ "<li><input type=\" checkbox\" disabled=\" \" /> Red</li>\n " ,
28+ "<li><input type=\" checkbox\" checked=\" \" disabled=\" \" /> Green</li>\n " ,
29+ "<li><input type=\" checkbox\" disabled=\" \" /> Blue</li>\n " ,
30+ "<li><input type=\" checkbox\" checked=\" \" disabled=\" \" /> Papayawhip</li>\n " ,
31+ "</ul>\n " ,
32+ "<!-- end list -->\n " ,
33+ "<ol>\n " ,
34+ "<li><input type=\" checkbox\" disabled=\" \" /> Bird</li>\n " ,
35+ "<li><input type=\" checkbox\" disabled=\" \" /> McHale</li>\n " ,
36+ "<li><input type=\" checkbox\" checked=\" \" disabled=\" \" /> Parish</li>\n " ,
37+ "</ol>\n " ,
38+ "<!-- end list -->\n " ,
39+ "<ul>\n " ,
40+ "<li><input type=\" checkbox\" disabled=\" \" /> Red\n " ,
41+ "<ul>\n " ,
42+ "<li><input type=\" checkbox\" checked=\" \" disabled=\" \" /> Green\n " ,
43+ "<ul>\n " ,
44+ "<li><input type=\" checkbox\" disabled=\" \" /> Blue</li>\n " ,
45+ "</ul>\n " ,
46+ "</li>\n " ,
47+ "</ul>\n " ,
48+ "</li>\n " ,
49+ "</ul>\n "
50+ ) ,
51+ ) ;
52+ }
53+
54+ #[ test]
55+ fn tasklist_with_classes ( ) {
56+ html_opts ! (
57+ [
58+ render. unsafe_,
59+ extension. tasklist,
60+ render. tasklist_classes,
61+ parse. relaxed_tasklist_matching
62+ ] ,
63+ concat!(
64+ "* [ ] Red\n " ,
65+ "* [x] Green\n " ,
66+ "* [ ] Blue\n " ,
67+ "* [!] Papayawhip\n " ,
68+ "<!-- end list -->\n " ,
69+ "1. [ ] Bird\n " ,
70+ "2. [ ] McHale\n " ,
71+ "3. [x] Parish\n " ,
72+ "<!-- end list -->\n " ,
73+ "* [ ] Red\n " ,
74+ " * [x] Green\n " ,
75+ " * [ ] Blue\n "
76+ ) ,
2577 concat!(
2678 "<ul class=\" contains-task-list\" >\n " ,
2779 "<li class=\" task-list-item\" ><input type=\" checkbox\" class=\" task-list-item-checkbox\" disabled=\" \" /> Red</li>\n " ,
@@ -57,8 +109,8 @@ fn tasklist_relaxed_regression() {
57109 [ extension. tasklist, parse. relaxed_tasklist_matching] ,
58110 "* [!] Red\n " ,
59111 concat!(
60- "<ul class= \" contains-task-list \" >\n " ,
61- "<li class= \" task-list-item \" ><input type=\" checkbox \" class= \" task-list-item- checkbox\" checked=\" \" disabled=\" \" /> Red</li>\n " ,
112+ "<ul>\n " ,
113+ "<li><input type=\" checkbox\" checked=\" \" disabled=\" \" /> Red</li>\n " ,
62114 "</ul>\n "
63115 ) ,
64116 ) ;
@@ -72,6 +124,35 @@ fn tasklist_relaxed_regression() {
72124 html_opts ! (
73125 [ extension. tasklist, parse. relaxed_tasklist_matching] ,
74126 "* [!] Red\n " ,
127+ concat!(
128+ "<ul>\n " ,
129+ "<li><input type=\" checkbox\" checked=\" \" disabled=\" \" /> Red</li>\n " ,
130+ "</ul>\n "
131+ ) ,
132+ ) ;
133+ }
134+
135+ #[ test]
136+ fn tasklist_with_classes_relaxed_regression ( ) {
137+ html_opts ! (
138+ [ extension. tasklist, render. tasklist_classes, parse. relaxed_tasklist_matching] ,
139+ "* [!] Red\n " ,
140+ concat!(
141+ "<ul class=\" contains-task-list\" >\n " ,
142+ "<li class=\" task-list-item\" ><input type=\" checkbox\" class=\" task-list-item-checkbox\" checked=\" \" disabled=\" \" /> Red</li>\n " ,
143+ "</ul>\n "
144+ ) ,
145+ ) ;
146+
147+ html_opts ! (
148+ [ extension. tasklist, render. tasklist_classes] ,
149+ "* [!] Red\n " ,
150+ concat!( "<ul>\n " , "<li>[!] Red</li>\n " , "</ul>\n " ) ,
151+ ) ;
152+
153+ html_opts ! (
154+ [ extension. tasklist, render. tasklist_classes, parse. relaxed_tasklist_matching] ,
155+ "* [!] Red\n " ,
75156 concat!(
76157 "<ul class=\" contains-task-list\" >\n " ,
77158 "<li class=\" task-list-item\" ><input type=\" checkbox\" class=\" task-list-item-checkbox\" checked=\" \" disabled=\" \" /> Red</li>\n " ,
@@ -89,6 +170,25 @@ fn tasklist_32() {
89170 "- [ ] This list item is **bold**\n " ,
90171 "- [x] There is some `code` here\n "
91172 ) ,
173+ concat!(
174+ "<ul>\n " ,
175+ "<li><input type=\" checkbox\" disabled=\" \" /> List item 1</li>\n " ,
176+ "<li><input type=\" checkbox\" disabled=\" \" /> This list item is <strong>bold</strong></li>\n " ,
177+ "<li><input type=\" checkbox\" checked=\" \" disabled=\" \" /> There is some <code>code</code> here</li>\n " ,
178+ "</ul>\n "
179+ ) ,
180+ ) ;
181+ }
182+
183+ #[ test]
184+ fn tasklist_32_with_classes ( ) {
185+ html_opts ! (
186+ [ render. unsafe_, extension. tasklist, render. tasklist_classes] ,
187+ concat!(
188+ "- [ ] List item 1\n " ,
189+ "- [ ] This list item is **bold**\n " ,
190+ "- [x] There is some `code` here\n "
191+ ) ,
92192 concat!(
93193 "<ul class=\" contains-task-list\" >\n " ,
94194 "<li class=\" task-list-item\" ><input type=\" checkbox\" class=\" task-list-item-checkbox\" disabled=\" \" /> List item 1</li>\n " ,
0 commit comments