From 22bf3e64ab72d7572de63bbbbf33bbfb94f27a52 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sat, 14 Feb 2026 16:29:43 -0700 Subject: [PATCH] fix: Improve VIS VRB remark parsing for mixed fractions Co-authored-by: aider (gemini/gemini-2.5-pro) --- metar.html | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/metar.html b/metar.html index c6a6a4e..0e7c2b7 100644 --- a/metar.html +++ b/metar.html @@ -317,8 +317,19 @@ { match: p => p[0] === 'VIS' && p.length > 2 && p[1] === 'VRB' && p[2].includes('-'), decode: p => { - const [min, max] = p[2].split('-'); - return { consumed: 3, text: ` - VIS VRB ${p[2]}: Visibility variable between ${min} and ${max} statute miles` }; + const [min, max_part1] = p[2].split('-'); + let max = max_part1; + let consumed = 3; + let raw_range = p[2]; + + // Handle fractional part for max visibility, e.g. VIS VRB 3/4-2 1/2 + if (p.length > 3 && /^\d+\/\d+$/.test(p[3])) { + max += ` ${p[3]}`; + consumed++; + raw_range += ` ${p[3]}`; + } + + return { consumed: consumed, text: ` - VIS VRB ${raw_range}: Visibility variable between ${min} and ${max} statute miles` }; } }, // VIS