Skip to content

Commit a6a673f

Browse files
committed
Rewrite part
1 parent 3e37dc0 commit a6a673f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Elastic.Markdown/Myst/Directives/Stepper/StepViewModel.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// See the LICENSE file in the project root for more information
44

55
using Elastic.Markdown.Helpers;
6+
using Elastic.Markdown.IO;
67
using Markdig.Syntax;
78
using Markdig.Syntax.Inlines;
89
using Microsoft.AspNetCore.Html;
@@ -22,10 +23,15 @@ public HtmlString RenderTitle()
2223
{
2324
// Parse the title as markdown with full pipeline (including substitutions)
2425
var directiveBlock = (DirectiveBlock)DirectiveBlock;
26+
27+
// Get the YamlFrontMatter from the original document to support local substitutions
28+
var originalContext = directiveBlock.GetData("context") as ParserContext;
29+
var yamlFrontMatter = originalContext?.YamlFrontMatter;
30+
2531
var context = new ParserContext(new ParserState(directiveBlock.Build)
2632
{
2733
MarkdownSourcePath = directiveBlock.CurrentFile,
28-
YamlFrontMatter = null,
34+
YamlFrontMatter = yamlFrontMatter,
2935
DocumentationFileLookup = (path) => null!,
3036
CrossLinkResolver = null!
3137
});

0 commit comments

Comments
 (0)