mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 06:27:21 +00:00
Highlighted code blocks inside the app (#1153)
This commit is contained in:
1 parent
0b42c0288e
commit
f4a86c2fb8
60 files changed
+2550
-41
No files matched your search
@@ -0,0 +1,21 @@
|
||||
using AIStudio.Tools;
|
||||
using AIStudio.Tools.CodeHighlighting;
|
||||
|
||||
namespace AIStudio.Tests.Tools.CodeHighlighting;
|
||||
|
||||
/// <summary>
|
||||
/// Checks that every kind of part takes its color from the style sheet of MudBlazor.Markdown, which
|
||||
/// colors the code blocks with the palette of the theme.
|
||||
/// </summary>
|
||||
[TestFixture]
|
||||
public sealed class CodeTokenKindExtensionsTests
|
||||
{
|
||||
[Test]
|
||||
public async Task EveryKindHasAClassWhichTheStyleSheetColors([Values] CodeTokenKind kind)
|
||||
{
|
||||
var styleSheet = await new WebRootFiles().ReadTextAsync("system/MudBlazor.Markdown/MudBlazor.Markdown.min.css");
|
||||
var cssClass = kind.ToCssClass().Split(' ')[0];
|
||||
|
||||
Assert.That(styleSheet, Does.Contain($".{cssClass}"), "A library which renames its classes would leave this kind without color.");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user