🐛 Serval bug fixes in hosted page

This commit is contained in:
2025-11-22 17:43:52 +08:00
parent 7b7a6c9218
commit ec21a94921
5 changed files with 35 additions and 43 deletions

View File

@@ -12,10 +12,9 @@ public class IndexModel(
PostService.PostServiceClient postClient,
RemotePublisherService rps,
RemoteAccountService ras,
MarkdownConverter markdownConverter // Inject MarkdownConverter
MarkdownConverter markdownConverter
) : PageModel
{
private readonly MarkdownConverter _markdownConverter = markdownConverter; // Store the injected service
public SnPublicationSite? Site { get; set; }
public SnPublisher? Publisher { get; set; }
public Account? UserAccount { get; set; }
@@ -62,7 +61,7 @@ public class IndexModel(
foreach (
var post in FeaturedPosts.Where(post => !string.IsNullOrEmpty(post.Content))
)
post.Content = _markdownConverter.ToHtml(post.Content!);
post.Content = markdownConverter.ToHtml(post.Content!);
}
}
}