@@ -598,40 +598,39 @@ end
598
598
local same_weights = {
599
599
' thin' ,
600
600
' light' ,
601
- ' normal' ,
602
601
' regular' ,
603
602
' medium' ,
604
603
' bold' ,
605
604
' black' ,
606
605
}
607
606
608
607
local weight_synonyms = {
608
+ [' normal' ] = ' regular' ,
609
609
[' ultra-light' ] = ' extra-light' ,
610
610
[' demi-bold' ] = ' semi-bold' ,
611
611
[' ultra-bold' ] = ' extra-bold' ,
612
612
}
613
613
614
614
local dashed_weights = {
615
615
' extra-light' ,
616
- ' ultra-light' ,
617
616
' semi-bold' ,
618
- ' demi-bold' ,
619
617
' extra-bold' ,
620
- ' ultra-bold' ,
621
618
}
622
619
623
620
local function translate_font_weight (w , warnings )
624
621
if not w then return nil end
625
622
local num = tonumber (w )
626
623
if num and 1 <= num and num <= 1000 then
627
624
return num
628
- elseif tcontains (same_weights , w ) then
625
+ end
626
+ w = weight_synonyms [w ] or w
627
+ if tcontains (same_weights , w ) then
629
628
return w
630
- elseif tcontains ( dashed_weights , w ) then
631
- w = weight_synonyms [ w ] or w
629
+ end
630
+ if tcontains ( dashed_weights , w ) then
632
631
return w :gsub (' -' , ' ' )
633
632
else
634
- output_warning (warnings , ' invalid font weight ' .. tostring (w ))
633
+ output_warning (null , ' invalid font weight ' .. tostring (w ))
635
634
return nil
636
635
end
637
636
end
@@ -770,6 +769,8 @@ local function expand_side_shorthand(items, context, warnings)
770
769
end
771
770
772
771
return {
772
+ quote = quote ,
773
+ dequote = dequote ,
773
774
set_brand_mode = set_brand_mode ,
774
775
parse_color = parse_color ,
775
776
parse_opacity = parse_opacity ,
0 commit comments