diff --git a/TASVideos.WikiEngine/NewParser.cs b/TASVideos.WikiEngine/NewParser.cs index 2d3909db9..3c1c0c1e1 100644 --- a/TASVideos.WikiEngine/NewParser.cs +++ b/TASVideos.WikiEngine/NewParser.cs @@ -884,7 +884,7 @@ private void ParseStartLine() var e = new Element(_index, "code"); if (lang != "") { - e.Attributes["class"] = "language-" + lang; + e.Attributes["class"] = "language-" + PrismNames.FixLanguage(lang); } e.Children.Add(new Text(_index, EatSrcEmbedText()) { CharEnd = _index }); diff --git a/TASVideos.WikiEngine/PrismNames.cs b/TASVideos.WikiEngine/PrismNames.cs new file mode 100644 index 000000000..97a3eecac --- /dev/null +++ b/TASVideos.WikiEngine/PrismNames.cs @@ -0,0 +1,15 @@ +namespace TASVideos.WikiEngine; + +public static class PrismNames +{ + public static string FixLanguage(string s) + { + return s switch + { + "bat" => "batch", + "sh" => "shell", + "c++" => "cpp", + _ => s + }; + } +} diff --git a/TASVideos/Pages/UserFiles/Info.cshtml.cs b/TASVideos/Pages/UserFiles/Info.cshtml.cs index cb4dd6c1b..b567dd091 100644 --- a/TASVideos/Pages/UserFiles/Info.cshtml.cs +++ b/TASVideos/Pages/UserFiles/Info.cshtml.cs @@ -11,7 +11,7 @@ namespace TASVideos.Pages.UserFiles; [AllowAnonymous] public class InfoModel : BasePageModel { - private static readonly string[] PreviewableExtensions = { "wch", "lua" }; + private static readonly string[] PreviewableExtensions = { "avs", "bat", "lua", "sh", "wch" }; private readonly ApplicationDbContext _db; private readonly IFileService _fileService;