Skip to content

Commit 0b2ebeb

Browse files
committed
Allow a space after {{
1 parent bf4cb8c commit 0b2ebeb

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Elastic.Markdown/Myst/InlineParsers/Substitution/SubstitutionParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public override bool Match(InlineProcessor processor, ref StringSlice slice)
176176
startPosition -= openSticks;
177177
startPosition = Math.Max(startPosition, 0);
178178

179-
var key = content.ToString().Trim(['{', '}']).ToLowerInvariant();
179+
var key = content.ToString().Trim(['{', '}']).Trim().ToLowerInvariant();
180180
var found = false;
181181
var replacement = string.Empty;
182182
var components = key.Split('|');

tests/authoring/Inline/Substitutions.fs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ The following should be subbed: {{hello-world}}
4646
not a comment
4747
not a {{valid-key}}
4848
not a {substitution}
49+
The following should be subbed too: {{ hello-world }}
4950
"""
5051

5152
[<Fact>]
@@ -58,5 +59,7 @@ not a {substitution}
5859
<p>The following should be subbed: Hello World!
5960
not a comment
6061
not a {{valid-key}}
61-
not a {substitution}</p>
62+
not a {substitution}
63+
The following should be subbed too: Hello World!
64+
</p>
6265
"""

0 commit comments

Comments
 (0)