fix: extractSectionMarks가 collect 노드 스키마 자식 마크를 섹션 구분자로 포함하는 버그 수정

수집 노드의 직접 자식(스키마 inline 마크)은 섹션 경계가 아니므로
sectionMarks에서 제외. parseInstance에서 김양모12시 같은
레코드 데이터가 새 섹션 헤더로 오파싱되던 문제 해결.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 18:26:13 +09:00
parent 2d6be54c02
commit 39f48dca4b

View File

@@ -1519,7 +1519,15 @@ function renderFillerTemplateView(){
// ── 파싱 & 합치기 ──────────────────────────────────────
function extractSectionMarks(node){
const marks=new Set();
function walk(n){ for(const c of n.children??[]){ if(c.type==='SECTION'){ const m=c.attributes?.mark??''; if(m) marks.add(m); walk(c); } } }
function walk(n){
const parentCollect=n.attributes?.collect==='true';
for(const c of n.children??[]){
if(c.type!=='SECTION') continue;
// 수집 노드의 직접 자식은 스키마(inline 마크) — 섹션 구분자로 쓰지 않음
if(!parentCollect){ const m=c.attributes?.mark??''; if(m) marks.add(m); }
walk(c);
}
}
walk(node);
return [...marks];
}