]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add a tertiary header parser to the guidebook document parser (#35315)
authorpathetic meowmeow <uhhadd@gmail.com>
Sun, 23 Feb 2025 18:48:38 +0000 (13:48 -0500)
committerGitHub <noreply@github.com>
Sun, 23 Feb 2025 18:48:38 +0000 (19:48 +0100)
Content.Client/Guidebook/DocumentParsingManager.static.cs

index 5d25d8f64525c44c6970f5f64ef69fe0756f7696..3e37942381c02534ce99a0217feee437ad06f2f4 100644 (file)
@@ -109,7 +109,17 @@ public sealed partial class DocumentParsingManager
             .Cast<Control>()))
         .Labelled("subheader");
 
-    private static readonly Parser<char, Control> TryHeaderControl = OneOf(SubHeaderControlParser, HeaderControlParser);
+    private static readonly Parser<char, Control> TertiaryHeaderControlParser = Try(String("###"))
+        .Then(SkipWhitespaces.Then(Map(text => new Label
+                {
+                    Text = text,
+                    StyleClasses = { "LabelKeyText" }
+                },
+                AnyCharExcept('\n').AtLeastOnceString())
+            .Cast<Control>()))
+        .Labelled("tertiaryheader");
+
+    private static readonly Parser<char, Control> TryHeaderControl = OneOf(TertiaryHeaderControlParser, SubHeaderControlParser, HeaderControlParser);
 
     private static readonly Parser<char, Control> ListControlParser = Try(Char('-'))
         .Then(SkipWhitespaces)