CommonMark.NET
This commit is contained in:
@ -325,7 +325,11 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
|
||||
private static void WriteMarkdownFile(FileConnectorConfiguration fileConnectorConfiguration, string[] alternateTargetFolders, ReadOnlyCollection<WorkItem> workItems, ReadOnlyCollection<string> workItemTypes)
|
||||
{
|
||||
string old;
|
||||
string html;
|
||||
string text;
|
||||
string json;
|
||||
string checkFile;
|
||||
string? pathRoot;
|
||||
List<char> spaces = new();
|
||||
List<string> lines = new();
|
||||
@ -356,7 +360,16 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
foreach (string workItemType in workItemTypes)
|
||||
{
|
||||
AppendLines(spaces, lines, workItemAndChildren, workItemType);
|
||||
File.WriteAllText(Path.Combine(alternateTargetFolder, $"{workItemType}.md"), string.Join(Environment.NewLine, lines));
|
||||
checkFile = Path.Combine(alternateTargetFolder, $"{workItemType}.md");
|
||||
text = string.Join(Environment.NewLine, lines);
|
||||
old = !File.Exists(checkFile) ? string.Empty : File.ReadAllText(checkFile);
|
||||
if (text != old)
|
||||
File.WriteAllText(checkFile, text);
|
||||
checkFile = Path.Combine(alternateTargetFolder, $"{workItemType}.html");
|
||||
html = CommonMark.CommonMarkConverter.Convert(text);
|
||||
old = !File.Exists(checkFile) ? string.Empty : File.ReadAllText(checkFile);
|
||||
if (html != old)
|
||||
File.WriteAllText(checkFile, html);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user