feat: add C# syntax highlighting (#1651)
Wire the @replit/codemirror-lang-csharp Lezer grammar into @getpaseo/highlight following the existing per-language pattern (Java/Rust/Swift). Map the cs extension to the parser and alias the csharp and c# markdown fence names so fenced code blocks highlight. Register csharpLanguage.parser rather than the package's raw parser export: the highlight styleTags are applied only inside csharpLanguage (via parser.configure), so the raw parser would parse but render unstyled. Closes #1527 Co-authored-by: Clemens Wagner <wagner.clemens@gmx.de> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Clemens Wagner
Claude Opus 4.8
parent
85322c5968
commit
6277ba1ff9
@@ -15,6 +15,7 @@ describe("isLanguageSupported", () => {
|
||||
expect(isLanguageSupported("test.java")).toBe(true);
|
||||
expect(isLanguageSupported("test.swift")).toBe(true);
|
||||
expect(isLanguageSupported("test.dart")).toBe(true);
|
||||
expect(isLanguageSupported("test.cs")).toBe(true);
|
||||
expect(isLanguageSupported("test.ex")).toBe(true);
|
||||
});
|
||||
|
||||
@@ -53,6 +54,7 @@ describe("getSupportedExtensions", () => {
|
||||
expect(extensions).toContain("rs");
|
||||
expect(extensions).toContain("swift");
|
||||
expect(extensions).toContain("dart");
|
||||
expect(extensions).toContain("cs");
|
||||
expect(extensions).toContain("json");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user