From 8bf757a45e49f654f2398b3cdc7e9f596863b21d Mon Sep 17 00:00:00 2001 From: "Adam R. Grey" Date: Thu, 28 Oct 2021 09:10:07 -0400 Subject: [PATCH] there are words which nextcloud would call illegal that this system wouldn't which is fair. But I have no ability to be sure I have all the necessary characters. --- ShowHandler.cs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/ShowHandler.cs b/ShowHandler.cs index 69fd88f..18d30a3 100644 --- a/ShowHandler.cs +++ b/ShowHandler.cs @@ -60,7 +60,8 @@ namespace director Directory.CreateDirectory(outputPath); checklistFilename = $"checklist ({todo.Occurrence._event.Summary}).md"; - foreach (char c in System.IO.Path.GetInvalidFileNameChars()) + var invalidFilenames = System.IO.Path.GetInvalidFileNameChars().Concat(new char[] {'(', ')', ':'}); + foreach (char c in invalidFilenames) { checklistFilename = checklistFilename.Replace(c, '_'); } @@ -68,17 +69,6 @@ namespace director Console.WriteLine($"checklistFilename: {checklistFilename}"); WriteChecklist(); - // don't actually know how to share via webdav. But also nextcloud doesn't seem to cooperate anyway. - // #region share with humans - // if (todo.Configuration.checklist?.FirstOrDefault(pl => pl.type == LineType.manual) != null) - // { - // Console.WriteLine($"nothing manual, not sharing with humans."); - // } - // else - // { - // //TODO: share - // } - // #endregion } private void WriteChecklist() { @@ -91,6 +81,10 @@ namespace director { text.Append("* [ ] "); } + else + { + text.AppendLine(); + } text.AppendLine($"{line.description}"); } File.WriteAllText(checklistFilename, text.ToString());