Skip to content

Commit 088857c

Browse files
committed
whitespace after bracket is fine now
1 parent dafdc70 commit 088857c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

SharpDenizenTools/MetaHandlers/TagHelper.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using FreneticUtilities.FreneticExtensions;
2+
using FreneticUtilities.FreneticToolkit;
23
using SharpDenizenTools.MetaObjects;
34
using System;
45
using System.Collections.Generic;
@@ -11,6 +12,9 @@ namespace SharpDenizenTools.MetaHandlers
1112
/// <summary>Helper to parse tags.</summary>
1213
public static class TagHelper
1314
{
15+
/// <summary>Matcher for basic whitespace characters.</summary>
16+
public static AsciiMatcher Whitespace = new(" \t\r\n");
17+
1418
/// <summary>Parses the plaintext of a tag into something analyzable.</summary>
1519
public static SingleTag Parse(string tag, Action<string> trackErrors)
1620
{
@@ -66,7 +70,7 @@ public static SingleTag Parse(string tag, Action<string> trackErrors)
6670
output.Fallback = tag[(i + 2)..];
6771
return output;
6872
}
69-
else if (foundABracket && brackets == 0 && !declaredMisformat)
73+
else if (foundABracket && brackets == 0 && !declaredMisformat && !Whitespace.IsMatch(tag[i]))
7074
{
7175
declaredMisformat = true;
7276
trackErrors("Invalid tag format, text after closing ']' symbol before '.' symbol");

0 commit comments

Comments
 (0)