Skip to content

Commit b246c63

Browse files
committed
fix(import/markdown): TODO not properly handled after upgrade
1 parent 50859fd commit b246c63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/server/src/services/import/markdown.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class CustomMarkdownRenderer extends Renderer {
6666
// Handle todo-list in the CKEditor format.
6767
if (item.task) {
6868
let itemBody = '';
69-
const checkbox = this.checkbox({ checked: !!item.checked });
69+
const checkbox = this.checkbox({ checked: !!item.checked, raw: "- [ ]", type: "checkbox" });
7070
if (item.loose) {
7171
if (item.tokens[0]?.type === 'paragraph') {
7272
item.tokens[0].text = checkbox + item.tokens[0].text;
@@ -86,7 +86,7 @@ class CustomMarkdownRenderer extends Renderer {
8686
itemBody += checkbox;
8787
}
8888

89-
itemBody += `<span class="todo-list__label__description">${this.parser.parse(item.tokens, !!item.loose)}</span>`;
89+
itemBody += `<span class="todo-list__label__description">${this.parser.parse(item.tokens.filter(t => t.type !== "checkbox"))}</span>`;
9090
return `<li><label class="todo-list__label">${itemBody}</label></li>`;
9191
}
9292

0 commit comments

Comments
 (0)