Skip to content

Commit 4ae4693

Browse files
committed
feat: add checkbox text space
1 parent f1b5af9 commit 4ae4693

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const MarkdownItTodoLists: PluginWithOptions<MarkdownItTodoListOptions> = (md, o
3434
})
3535

3636
md.renderer.rules.todo_list_inline = function (tokens, idx) {
37-
const content = tokens[idx].content.slice(4)
37+
const content = tokens[idx].content.slice(3)
3838
const disabled = !enabled ? 'disabled' : ''
3939

4040
const inputWrapper = (content: string): string => `<label>${content}</label>`

test/output/index.base.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<ul class="todo-list-container">
2-
<li class="todo-list-item"><label><input class="todo-list-item-checkbox" type="checkbox" checked disabled />item 1</label></li>
3-
<li class="todo-list-item"><label><input class="todo-list-item-checkbox" type="checkbox" checked disabled />item 2</label></li>
2+
<li class="todo-list-item"><label><input class="todo-list-item-checkbox" type="checkbox" checked disabled /> item 1</label></li>
3+
<li class="todo-list-item"><label><input class="todo-list-item-checkbox" type="checkbox" checked disabled /> item 2</label></li>
44
</ul>

0 commit comments

Comments
 (0)