File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -153,7 +153,19 @@ function parseSnip(text) {
153153 const so = trimmed . match ( / ^ ( J u n o s | E V O ) \s * : \s * ( .* ) $ / i) ;
154154 if ( so ) {
155155 const bucket = so [ 1 ] . toLowerCase ( ) === "evo" ? "evo" : "junos" ;
156- for ( const tok of so [ 2 ] . split ( / \s + / ) . filter ( Boolean ) ) seenOn [ bucket ] . push ( tok ) ;
156+ // Stop at the first token that begins a parenthetical note like
157+ // "(none in this JVD ...)" or "(and all other EVO PEs ...)". Only
158+ // tokens before the note are real device names. Authors sometimes
159+ // use these notes to indicate "no devices on this OS" or
160+ // "+ implicit others"; either way the prose should not become chips.
161+ // Also skip bare prose tokens like "—" used as a placeholder for
162+ // "not applicable".
163+ for ( const tok of so [ 2 ] . split ( / \s + / ) . filter ( Boolean ) ) {
164+ if ( tok . startsWith ( "(" ) ) break ;
165+ // A real device token must start with a letter or digit.
166+ if ( ! / ^ [ A - Z a - z 0 - 9 ] / . test ( tok ) ) continue ;
167+ seenOn [ bucket ] . push ( tok ) ;
168+ }
157169 }
158170 continue ;
159171 }
You can’t perform that action at this time.
0 commit comments