fix: 修复多占位符识别,补充测试

This commit is contained in:
MikiVL
2026-05-05 12:58:22 +08:00
parent 1f51665e42
commit 504bd2f65f
4 changed files with 14 additions and 4 deletions
+3 -3
View File
@@ -13,10 +13,10 @@ def parse_template(file_path: str) -> dict:
for row in ws.iter_rows():
for cell in row:
if cell.value and isinstance(cell.value, str):
m = PLACEHOLDER_RE.search(cell.value)
if m:
matches = PLACEHOLDER_RE.findall(cell.value)
for name in matches:
placeholders.append({
"name": m.group(1),
"name": name,
"sheet": sheet_name,
"cell": cell.coordinate,
})