mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 11:59:48 +00:00
Fix the I18N key collection to handle multiple quotes in content
This commit is contained in:
parent
90bd450193
commit
7b621578ea
@ -146,14 +146,23 @@ public sealed partial class CollectI18NKeysCommand
|
||||
var content = fileContent;
|
||||
while (startIdx > -1)
|
||||
{
|
||||
//
|
||||
// In some cases, after the initial " there follow more " characters.
|
||||
// We need to skip them:
|
||||
//
|
||||
content = content[(startIdx + START_TAG.Length)..];
|
||||
while(content[0] == '"')
|
||||
content = content[1..];
|
||||
|
||||
var endIdx = content.IndexOf(END_TAG);
|
||||
if (endIdx == -1)
|
||||
break;
|
||||
|
||||
var match = content[..endIdx];
|
||||
matches.Add(match.ToString());
|
||||
while (match[^1] == '"')
|
||||
match = match[..^1];
|
||||
|
||||
matches.Add(match.ToString());
|
||||
startIdx = content.IndexOf(START_TAG);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user