2026-02-26 07:51:22 +00:00
|
|
|
using Markdig;
|
|
|
|
|
|
2024-05-25 20:18:49 +00:00
|
|
|
namespace AIStudio.Tools;
|
|
|
|
|
|
|
|
|
|
public static class Markdown
|
|
|
|
|
{
|
2026-02-26 07:51:22 +00:00
|
|
|
public static readonly MarkdownPipeline SAFE_MARKDOWN_PIPELINE = new MarkdownPipelineBuilder()
|
|
|
|
|
.UseAdvancedExtensions()
|
|
|
|
|
.DisableHtml()
|
|
|
|
|
.Build();
|
|
|
|
|
|
2025-08-10 16:32:38 +00:00
|
|
|
public static MudMarkdownProps DefaultConfig => new()
|
2024-05-25 20:18:49 +00:00
|
|
|
{
|
2025-08-10 16:32:38 +00:00
|
|
|
Heading =
|
|
|
|
|
{
|
|
|
|
|
OverrideTypo = typo => typo switch
|
|
|
|
|
{
|
|
|
|
|
Typo.h1 => Typo.h4,
|
|
|
|
|
Typo.h2 => Typo.h5,
|
|
|
|
|
Typo.h3 => Typo.h6,
|
|
|
|
|
Typo.h4 => Typo.h6,
|
|
|
|
|
Typo.h5 => Typo.h6,
|
|
|
|
|
Typo.h6 => Typo.h6,
|
2024-05-25 20:18:49 +00:00
|
|
|
|
2025-08-10 16:32:38 +00:00
|
|
|
_ => typo,
|
|
|
|
|
},
|
|
|
|
|
}
|
2024-05-25 20:18:49 +00:00
|
|
|
};
|
|
|
|
|
}
|