Skip to content

Commit d1583ab

Browse files
committed
fix: correct list item handling and update tests for unordered lists
1 parent 606d7de commit d1583ab

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

ast/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func GetListItemKindAndIndent(node Node) (ListKind, int) {
1616
case *UnorderedListItem:
1717
return UnorderedList, n.Indent
1818
case *TaskListItem:
19-
return DescriptionList, n.Indent
19+
return UnorderedList, n.Indent
2020
default:
2121
return "", 0
2222
}

parser/registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ func (r *ParserRegistry) GetBlockParsers() []BlockParser {
6161
"horizontal_rule",
6262
"blockquote",
6363
"ordered_list",
64+
"task_list",
6465
"unordered_list",
6566
"table",
66-
"task_list",
6767
"math_block",
6868
"embedded_content",
6969
}

parser/tests/parser_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func TestParser(t *testing.T) {
198198
},
199199
},
200200
&ast.List{
201-
Kind: ast.DescriptionList,
201+
Kind: ast.UnorderedList,
202202
Children: []ast.Node{
203203
&ast.TaskListItem{
204204
Symbol: tokenizer.Hyphen,
@@ -217,7 +217,7 @@ func TestParser(t *testing.T) {
217217
text: "- [ ] hello\n- [x] world",
218218
nodes: []ast.Node{
219219
&ast.List{
220-
Kind: ast.DescriptionList,
220+
Kind: ast.UnorderedList,
221221
Children: []ast.Node{
222222
&ast.TaskListItem{
223223
Symbol: tokenizer.Hyphen,

renderer/html/html_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func TestHTMLRenderer(t *testing.T) {
6161
},
6262
{
6363
text: "- [ ] hello\n- [x] world",
64-
expected: `<dl><li><input type="checkbox" disabled />hello</li><br><li><input type="checkbox" checked disabled />world</li></dl>`,
64+
expected: `<ul><li><input type="checkbox" disabled />hello</li><br><li><input type="checkbox" checked disabled />world</li></ul>`,
6565
},
6666
}
6767

0 commit comments

Comments
 (0)