Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Elastic.Markdown/Myst/ParserContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ public ParserContext(
Configuration = configuration;

foreach (var (key, value) in configuration.Substitutions)
Properties[key] = value;
Properties[key.ToLowerInvariant()] = value;

if (frontMatter?.Properties is { } props)
{
foreach (var (key, value) in props)
foreach (var (k, value) in props)
{
var key = k.ToLowerInvariant();
if (configuration.Substitutions.TryGetValue(key, out _))
this.EmitError($"{{{key}}} can not be redeclared in front matter as its a global substitution");
else
Properties[key] = value;
}

}

if (frontMatter?.Title is { } title)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public override bool Match(InlineProcessor processor, ref StringSlice slice)
startPosition -= openSticks;
startPosition = Math.Max(startPosition, 0);

var key = content.ToString().Trim(['{', '}']);
var key = content.ToString().Trim(['{', '}']).ToLowerInvariant();
var found = false;
var replacement = string.Empty;
if (processor.Context?.Properties.TryGetValue(key, out var value) ?? false)
Expand Down