Highlighted code blocks inside the app (#1153)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-04 07:58:57 +01:00
1 parent 0b42c0288e
commit f4a86c2fb8
60 files changed
+2550 -41

No files matched your search

@@ -0,0 +1,26 @@
namespace AIStudio.Tools.CodeHighlighting.Languages;
/// <summary>
/// How a style sheet in CSS looks to the tokenizer.
/// </summary>
/// <remarks>
/// A style sheet has no statements: it has selectors, such as .card or #main, and blocks of properties
/// with their values. The tokenizer tells them apart by the braces. At-rules, such as @media, and
/// !important get the color of keywords, and a function, such as var(), that of functions.
/// </remarks>
public static class CssCodeRules
{
public static readonly CodeLanguageRules RULES = new()
{
IsStyleSheet = true,
BlockComments = [new("/*", "*/")],
Strings =
[
new("\"", "\""),
new("'", "'"),
],
WordStartCharacters = "-",
WordCharacters = "-",
};
}