File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ exports.JSON = async function(cssText) {
240
240
241
241
if ( / ^ [ . # a - z A - Z 0 - 9 \- \s , : ( ) % * \+ < > _ \[ \] = " ] + $ / . test ( selectorText ) ) {
242
242
const selectors = selectorText . split ( ',' ) . map ( s => s . trim ( ) ) ;
243
- const properties = { } ;
243
+ let properties = [ ] ;
244
244
const nestedRules = [ ] ;
245
245
246
246
while ( index < length ) {
@@ -270,7 +270,7 @@ exports.JSON = async function(cssText) {
270
270
271
271
if ( line . includes ( ':' ) ) {
272
272
const [ key , value ] = line . split ( ':' ) . map ( s => s . trim ( ) ) ;
273
- properties [ key ] = value ;
273
+ properties . push ( [ key , value ] ) ;
274
274
if ( cleanedCSS [ index ] === ';' ) index ++ ;
275
275
} else if ( cleanedCSS [ index ] === '}' ) {
276
276
index ++ ;
Original file line number Diff line number Diff line change @@ -44,9 +44,9 @@ async function serializeRules(rules) {
44
44
return `${ rule . name } {${ innerContent } }` ;
45
45
} else if ( rule . type === 'rule' ) {
46
46
const props = [ ] ;
47
- for ( const [ key , value ] of Object . entries ( rule . properties ) ) {
47
+ rule . properties . forEach ( ( [ key , value ] ) => {
48
48
props . push ( `${ key } :${ value } ` ) ;
49
- }
49
+ } ) ;
50
50
return `${ rule . selectors . join ( ',' ) } {${ props . join ( ';' ) } }` ;
51
51
} else if ( rule . type === 'insert' ) {
52
52
return rule . text ;
Original file line number Diff line number Diff line change @@ -328,9 +328,9 @@ async function lhl() {
328
328
const lighthighlight = await _just . parseCSS . JSON ( JSON . parse ( HIGHLIGHTJSON ) [ "_just_light" ] ) ;
329
329
lighthighlight . forEach ( rule => {
330
330
const props = [ ] ;
331
- for ( const [ keyy , valme ] of Object . entries ( rule . properties ) ) {
331
+ rule . properties . forEach ( ( [ keyy , valme ] ) => {
332
332
props . push ( `${ keyy } :${ valme } ` ) ;
333
- }
333
+ } ) ;
334
334
const outstr = ( addclass ) => `${ rule . selectors . map ( s => `.${ addclass } ${ s } ` ) . join ( ',' ) } {${ props . join ( ';' ) } }` ;
335
335
CSSHIGHLIGHT += outstr ( cssclass . l ) ;
336
336
CSSHIGHLIGHT += `@media (prefers-color-scheme: light) {${ outstr ( cssclass . a ) } }` ;
You can’t perform that action at this time.
0 commit comments