File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1589,7 +1589,28 @@ namespace pxt {
15891589 }
15901590 if ( entry . tilemapTile ) {
15911591 tags . push ( "tile" ) ;
1592- tags . push ( "category-" + namespaceName )
1592+
1593+ let category : string = undefined ;
1594+ if ( entry . displayName && entry . displayName . indexOf ( "--" ) !== - 1 ) {
1595+ const rawCategory = entry . displayName . split ( "--" ) [ 1 ] . trim ( ) ;
1596+ const categoryParts = rawCategory . split ( / [ \s \- ] + / g) . map ( ( part , index ) => {
1597+ if ( index === 0 ) {
1598+ return part
1599+ }
1600+ else {
1601+ return part . charAt ( 0 ) . toUpperCase ( ) + part . slice ( 1 ) ;
1602+ }
1603+ } ) ;
1604+ category = categoryParts . join ( "" ) ;
1605+ }
1606+
1607+ if ( ! category && ! / ^ t r a n s p a r e n c y (?: 4 | 8 | 1 6 | 3 2 ) $ / . test ( varName ) ) {
1608+ category = namespaceName
1609+ }
1610+
1611+ if ( category ) {
1612+ tags . push ( "category-" + category ) ;
1613+ }
15931614 }
15941615 }
15951616
You can’t perform that action at this time.
0 commit comments