Skip to content

Commit 40f22a4

Browse files
committed
fix: strip TOML comments before processing section headers
1 parent a7e6822 commit 40f22a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

UnityMcpBridge/Editor/Helpers/CodexConfigHelper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public static string UpsertCodexServerBlock(string existingToml, string newBlock
6060
bool replaced = false;
6161
while ((line = reader.ReadLine()) != null)
6262
{
63-
string trimmed = line.Trim();
63+
string sanitizedLine = StripTomlComment(line);
64+
string trimmed = sanitizedLine.Trim();
6465
bool isSection = trimmed.StartsWith("[") && trimmed.EndsWith("]") && !trimmed.StartsWith("[[");
6566
if (isSection)
6667
{

0 commit comments

Comments
 (0)