Skip to content

Commit c934429

Browse files
committed
feat: Update PostPageGenerator to enhance markdown processing and template file handling
1 parent fb9109d commit c934429

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Blog/PostPage/PostPageGenerator.Markdown.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ private string TransformMarkdownToHtml(string markdown)
7474
// Gap #1 resolution: Use Markdig Advanced Extensions pipeline
7575
var pipeline = new MarkdownPipelineBuilder()
7676
.UseAdvancedExtensions()
77+
.UseSoftlineBreakAsHardlineBreak()
7778
.Build();
7879

7980
return Markdown.ToHtml(markdown, pipeline);

src/Blog/PostPage/PostPageGenerator.Template.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ private async Task CopyTemplateAssetsAsync(
8282
var relativePath = await templateFolder.GetRelativePathToAsync(file);
8383

8484
// Create file at relative path in output folder (creates necessary parent folders)
85-
var targetStorable = await outputFolder.CreateByRelativePathAsync(relativePath, StorableType.File, overwrite: true);
86-
85+
var targetStorable = await outputFolder.CreateByRelativePathAsync(relativePath, StorableType.File);
8786
if (targetStorable is not IFile targetFile)
8887
throw new InvalidOperationException($"Created item at '{relativePath}' is not a file.");
8988

9089
// Copy file content
9190
using var sourceStream = await file.OpenReadAsync();
92-
using var targetStream = await targetFile.OpenStreamAsync(FileAccess.Write);
93-
await sourceStream.CopyToAsync(targetStream);
91+
using var destinationStream = await targetFile.OpenWriteAsync();
92+
await sourceStream.CopyToAsync(destinationStream);
93+
await destinationStream.FlushAsync();
9494
}
9595
}
9696

0 commit comments

Comments
 (0)