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 }; } } },