Skip to content

Commit d5dbe8c

Browse files
authored
Do the same for the # comment char
1 parent 7a18a3d commit d5dbe8c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Elastic.Markdown/Myst/CodeBlocks/EnhancedCodeBlockParser.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ private static List<CallOut> EnumerateAnnotations(Regex.ValueMatchEnumerator mat
238238

239239
private static CallOut? ParseMagicCallout(ValueMatch match, ref ReadOnlySpan<char> span, ref int callOutIndex, int originatingLine)
240240
{
241-
var startIndex = Math.Max(span.LastIndexOf(" // "), span.LastIndexOf('#'));
241+
var startIndex = Math.Max(span.LastIndexOf(" // "), span.LastIndexOf(" # "));
242242
if (startIndex <= 0)
243243
return null;
244244

@@ -248,7 +248,7 @@ private static List<CallOut> EnumerateAnnotations(Regex.ValueMatchEnumerator mat
248248
return new CallOut
249249
{
250250
Index = callOutIndex,
251-
Text = callout.TrimStart().TrimStart('/').TrimStart('#').TrimStart().ToString(),
251+
Text = callout.TrimStart().TrimStart('/').TrimStart(" # ").TrimStart().ToString(),
252252
InlineCodeAnnotation = true,
253253
SliceStart = startIndex,
254254
Line = originatingLine,
@@ -257,7 +257,7 @@ private static List<CallOut> EnumerateAnnotations(Regex.ValueMatchEnumerator mat
257257

258258
private static List<CallOut> ParseClassicCallOuts(ValueMatch match, ref ReadOnlySpan<char> span, ref int callOutIndex, int originatingLine)
259259
{
260-
var indexOfLastComment = Math.Max(span.LastIndexOf('#'), span.LastIndexOf(" // "));
260+
var indexOfLastComment = Math.Max(span.LastIndexOf(" # "), span.LastIndexOf(" // "));
261261
var startIndex = span.LastIndexOf('<');
262262
if (startIndex <= 0)
263263
return [];

0 commit comments

Comments
 (0)