Skip to content

Commit b41fa67

Browse files
committed
cleanup and fix tests
1 parent 54c0f65 commit b41fa67

File tree

6 files changed

+4
-250
lines changed

6 files changed

+4
-250
lines changed

src/Elastic.Markdown/Myst/Directives/DirectiveBlockParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public override BlockState TryOpen(BlockProcessor processor)
160160
return BlockState.None;
161161

162162
var span = line.AsSpan();
163-
var lastIndent = span.LastIndexOf(":");
163+
var lastIndent = Math.Max(span.LastIndexOf("`"), span.LastIndexOf(":"));
164164
var startApplies = span.IndexOf("{applies_to}");
165165
var startOpen = span.IndexOf("{");
166166
if (startOpen > lastIndent + 1 || startApplies != -1)

src/Elastic.Markdown/Myst/FrontMatter/FrontMatterParser.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ public class YamlFrontMatter
1818
[YamlMember(Alias = "sub")]
1919
public Dictionary<string, string>? Properties { get; set; }
2020

21-
[YamlIgnore]
22-
[Obsolete("Use applies_to instead")]
23-
public Deployment? AppliesTo { get; set; }
24-
2521
[YamlMember(Alias = "applies_to")]
26-
public ApplicableTo? Apply { get; set; }
22+
public ApplicableTo? AppliesTo { get; set; }
2723
}

src/Elastic.Markdown/Slices/HtmlWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public async Task<string> RenderLayout(MarkdownFile markdown, Cancel ctx = defau
6868
NextDocument = next,
6969
NavigationHtml = navigationHtml,
7070
UrlPathPrefix = markdown.UrlPathPrefix,
71-
Applies = markdown.YamlFrontMatter?.Apply,
71+
Applies = markdown.YamlFrontMatter?.AppliesTo,
7272
GithubEditUrl = editUrl,
7373
AllowIndexing = DocumentationSet.Context.AllowIndexing && !markdown.Hidden
7474
});

tests/Elastic.Markdown.Tests/Directives/AppliesBlockTests.cs

Lines changed: 0 additions & 80 deletions
This file was deleted.

tests/Elastic.Markdown.Tests/FrontMatter/ProductConstraintTests.cs

Lines changed: 0 additions & 162 deletions
This file was deleted.

tests/authoring/Framework/MarkdownDocumentAssertions.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module MarkdownDocumentAssertions =
3434
let matter = result.File.YamlFrontMatter
3535
match matter with
3636
| NonNull m ->
37-
let apply = m.Apply
37+
let apply = m.AppliesTo
3838
test <@ apply = expectedAvailability @>
3939
| _ -> failwithf "%s has no yamlfront matter" result.File.RelativePath
4040

0 commit comments

Comments
 (0)