diff --git a/gitnexus/src/core/ingestion/documents/xaml.ts b/gitnexus/src/core/ingestion/documents/xaml.ts index 828a1b9b3..cfc544344 100644 --- a/gitnexus/src/core/ingestion/documents/xaml.ts +++ b/gitnexus/src/core/ingestion/documents/xaml.ts @@ -68,10 +68,14 @@ export function extractXamlDeclarations(source: string): DocumentDeclaration[] { !DIRECTIVES.has(parts[1]) ) continue; - if (typeof value !== 'string' || !value.trim() || /[{}&]/.test(value)) continue; + if (typeof value !== 'string' || value.includes('&')) continue; + // A leading {} escapes the entire remaining value, including further braces. + const escaped = value.startsWith('{}'); + const name = escaped ? value.slice(2) : value; + if (!name.trim() || (!escaped && /[{}]/.test(name))) continue; if (span?.startIndex === undefined || span.endIndex === undefined) continue; declarations.push({ - name: value, + name, description: `${tag} x:${parts[1]} declaration`, startIndex: span.startIndex, startLine: lineAt(span.startIndex), diff --git a/gitnexus/test/integration/xaml-documents.test.ts b/gitnexus/test/integration/xaml-documents.test.ts index 904efc502..5575c506f 100644 --- a/gitnexus/test/integration/xaml-documents.test.ts +++ b/gitnexus/test/integration/xaml-documents.test.ts @@ -17,7 +17,7 @@ describe('XAML pipeline documents (#3202)', () => { fixtures.push(repo); await fs.writeFile( path.join(repo.dbPath, 'Home.XAML'), - `\n