Open bubonicfred opened 3 years ago
@bubonicfred Thanks for reporting this.
Can I ask you to give me some examples (code / todo) so I'm clear on it and can reproduce this? I think I understand what you mean. Just want to be clear.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have a script that checks a particular file for todos, sometimes (I believe when the first item in this is on line 1) Export-TodoTxt does not write to a new line. I realise I can fix this in my own script, but have opted to attempt to fix it in PsTodoTxt, using
`n
to insert newline, and the-NoNewLine
parameter to clear any new line theAddContent
cmdlet seems to put in by itself. The below seems to work, but I am by no means great at powershell so would like a more experienced opinion."`n$Todo" | ConvertFrom-TodoTxt | Add-Content -Path $Path -Encoding UTF8 -NoNewLine
I have no idea if that's the best approach, but IMO the Export-TodoTxt should be sanitising the input for newlines.