mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-24 03:06:16 +00:00
- Fix regex to handle both dash (-) and asterisk (*) prefixed tasks - Add quick test to verify parsing works for both formats - Ensure proper bullet/checkbox distinction in markdown parsing
27 lines
679 B
JavaScript
27 lines
679 B
JavaScript
#!/usr/bin/env node
|
|
|
|
import { BidirectionalSync } from './src/syncLogic';
|
|
|
|
async function testParsing() {
|
|
const sync = new BidirectionalSync();
|
|
|
|
const markdown = `
|
|
- [ ] Task with dash
|
|
- [x] Subtask with dash
|
|
* [ ] Task with asterisk
|
|
* [x] Subtask with asterisk
|
|
`;
|
|
|
|
// Access private method for testing
|
|
const parsed = (sync as any).parseMarkdown(markdown);
|
|
|
|
console.log('Parsed tasks:');
|
|
parsed.forEach((task, i) => {
|
|
console.log(`${i + 1}. "${task.title}" (${task.isDone ? 'done' : 'pending'})`);
|
|
task.subTasks.forEach((sub, j) => {
|
|
console.log(` ${j + 1}. "${sub.title}" (${sub.isDone ? 'done' : 'pending'})`);
|
|
});
|
|
});
|
|
}
|
|
|
|
testParsing();
|