From 0daf21c98a71a63f8930c180abb915ee41acb8d1 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sat, 14 Feb 2026 16:38:57 -0700 Subject: [PATCH] Fix: Parse VIS remarks with intermittent conditions Co-authored-by: aider (gemini/gemini-2.5-pro) --- metar.html | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/metar.html b/metar.html index 0855126..e19daa1 100644 --- a/metar.html +++ b/metar.html @@ -352,10 +352,22 @@ const visibility = p[2].replace('SM', ''); const direction = p[1]; const raw_vis = p[2]; - return { - consumed: 3, - text: ` - VIS ${direction} ${raw_vis}: Sector visibility ${visibility} statute miles to the ${decodeDirection(direction).replace(/ to /g, '-')}` - }; + let consumed = 3; + let raw_parts = ['VIS', direction, raw_vis]; + let text_parts = []; + + text_parts.push(`Visibility ${decodeDirection(direction)} ${visibility} miles`); + + if (p.length > 3 && p[3] === 'INTMT') { + consumed = 4; + raw_parts.push('INTMT'); + text_parts.push('intermittent'); + } + + const raw_remark = raw_parts.join(' '); + const text = ` - ${raw_remark}: ${text_parts.join(', ')}`; + + return { consumed, text }; } } },