Update headings list to display plain text, and add option to insert at beginning
Some checks failed
Node.js build / build (20.x) (push) Failing after 5m48s
Node.js build / build (22.x) (push) Failing after 5m45s

This commit is contained in:
2026-02-20 16:16:30 -08:00
parent 2fd5abf40d
commit 8fe38af7b3
4 changed files with 38 additions and 14 deletions

View File

@@ -49,6 +49,16 @@ export function removeTodoLine(content: string, lineNumber: number): string {
return lines.join('\n');
}
/**
* Insert a todo line at the beginning of the content.
*/
export function insertTodoAtBeginning(content: string, todoLine: string): string {
if (!content) {
return todoLine;
}
return todoLine + '\n' + content;
}
/**
* Insert a todo line at the end of the content.
* Handles files with/without trailing newlines.