diff options
Diffstat (limited to 'src/components/ParksTable.astro')
| -rw-r--r-- | src/components/ParksTable.astro | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/components/ParksTable.astro b/src/components/ParksTable.astro index 81a93e2..92b21c9 100644 --- a/src/components/ParksTable.astro +++ b/src/components/ParksTable.astro @@ -173,11 +173,17 @@ const waterText = (value: string) => { if (!text) return ""; if (/[??]/.test(text)) return "水飲み場?"; let total = 0; + let hasDrink = false; + let hasWash = false; for (const part of text.split(/[、,]/)) { const nums = [...part.matchAll(/[x×](\d+)/g)].map((m) => Number(m[1])); if (nums.length) total += nums.reduce((a, b) => a * b, 1); + if (/水飲/.test(part)) hasDrink = true; + if (/手洗/.test(part)) hasWash = true; } - return total > 0 ? `水飲み場x${total}` : "水飲み場"; + // 水飲み専用の水栓がなく、手洗いだけの場合はその旨を添える。 + const label = !hasDrink && hasWash ? "水飲み場(水飲水栓なし)" : "水飲み場"; + return total > 0 ? `${label}x${total}` : label; }; function disasterText(value: string): string { return value |
