File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ section[data-pane="develop"] > div > * {
6060: root .dark # cm-container .cm-editor .cm-line .ubol-literal {
6161 color : # 1dae74 ;
6262 }
63- # cm-container .cm-editor .cm-line .badline : not (. cm-activeLine ) {
63+ # cm-container .cm-editor .cm-line .badline {
6464 background-color : color-mix (in srgb, var (--info3-ink ) 15% , transparent 85% );
6565 }
6666
Original file line number Diff line number Diff line change @@ -515,7 +515,7 @@ export function rulesFromText(text) {
515515 if ( indices . length === 0 ) { continue ; }
516516 const result = ruleFromLines ( lines , indices ) ;
517517 if ( result . bad ) {
518- bad . push ( ...result . bad . slice ( 4 ) ) ;
518+ bad . push ( ...result . bad . slice ( 0 , 4 ) ) ;
519519 } else if ( result . rule ) {
520520 rules . push ( result . rule ) ;
521521 }
Original file line number Diff line number Diff line change @@ -89,8 +89,20 @@ const perScopeParsers = {
8989} ;
9090
9191const addHostnameToMode = ( modes , mode , node ) => {
92- if ( node . list !== true ) { return false ; }
93- modes [ mode ] . push ( punycode . toASCII ( node . val ) ) ;
92+ if ( node . list !== true ) { return node . val === '-' ; }
93+ if ( node . key !== undefined ) { return false ; }
94+ if ( node . val === undefined ) { return false ; }
95+ const hn = punycode . toASCII ( node . val . toLowerCase ( ) ) ;
96+ if ( hn . length > 253 ) { return false ; }
97+ if ( hn . split ( '.' ) . some ( isInvalidLabel ) ) { return false ; }
98+ modes [ mode ] . push ( hn ) ;
99+ } ;
100+
101+ const isInvalidLabel = label => {
102+ if ( label . length === 0 ) { return true ; }
103+ if ( label . length > 63 ) { return true ; }
104+ if ( / ^ [ ^ \d a - z ] | [ ^ \d a - z ] $ | [ ^ \d a - z - ] / . test ( label ) ) { return true ; }
105+ return false ;
94106} ;
95107
96108/******************************************************************************/
You can’t perform that action at this time.
0 commit comments