Override header styles for Markdown

This commit is contained in:
Thorsten Sommer 2024-05-25 22:18:49 +02:00
parent 2abc9a1436
commit a6e9ef7757
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 17 additions and 0 deletions

View File

@ -36,6 +36,7 @@
else
{
<MudMarkdown Value="@textContent.Text"/>
<MudMarkdown Value="@textContent.Text" OverrideHeaderTypo="@Markdown.OverrideHeaderTypo"/>
}
}

View File

@ -0,0 +1,16 @@
namespace AIStudio.Tools;
public static class Markdown
{
public static Typo OverrideHeaderTypo(Typo arg) => arg 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,
_ => arg
};
}