Skip to content

Commit 22db85b

Browse files
theletterfMpdreamz
andauthored
Update src/Elastic.Markdown/Myst/Linters/SpaceNormalizer.cs
Co-authored-by: Martijn Laarman <[email protected]>
1 parent f1cce89 commit 22db85b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Elastic.Markdown/Myst/Linters/SpaceNormalizer.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,15 @@ public override bool Match(InlineProcessor processor, ref StringSlice slice)
8282
var context = processor.GetContext();
8383
var filePath = context.MarkdownSourcePath.FullName;
8484

85+
if (FilesWithHintEmitted.Contains(filePath))
86+
return;
8587
lock (FilesWithHintEmitted)
8688
{
87-
if (!FilesWithHintEmitted.Contains(filePath))
88-
{
89-
_ = FilesWithHintEmitted.Add(filePath);
90-
processor.EmitHint(processor.Inline, 1, "Irregular space detected. Run 'docs-builder format' to automatically fix all instances.");
91-
}
89+
if (FilesWithHintEmitted.Contains(filePath))
90+
return;
91+
92+
_ = FilesWithHintEmitted.Add(filePath);
93+
processor.EmitHint(processor.Inline, 1, "Irregular space detected. Run 'docs-builder format' to automatically fix all instances.");
9294
}
9395

9496
slice.SkipChar();

0 commit comments

Comments
 (0)