diff --git a/lua/wikis/commons/MatchGroup/Display/SingleMatch.lua b/lua/wikis/commons/MatchGroup/Display/SingleMatch.lua index 35c82728139..c3317600210 100644 --- a/lua/wikis/commons/MatchGroup/Display/SingleMatch.lua +++ b/lua/wikis/commons/MatchGroup/Display/SingleMatch.lua @@ -22,7 +22,7 @@ local SingleMatchDisplay = {} ---@return table function SingleMatchDisplay.configFromArgs(args) return { - width = tonumber((string.gsub(args.width or '', 'px', ''))), + width = args.width, } end diff --git a/lua/wikis/commons/MatchSummary/Base.lua b/lua/wikis/commons/MatchSummary/Base.lua index 22debcc9fd6..8e234bf1c8f 100644 --- a/lua/wikis/commons/MatchSummary/Base.lua +++ b/lua/wikis/commons/MatchSummary/Base.lua @@ -293,9 +293,11 @@ function MatchSummary.defaultGetByMatchId(CustomMatchSummary, args, options) args.bracketId, args.matchId) ---@type (fun(match: MatchGroupUtilMatch):string?)|string|integer? - local width = options.width or args.width + local width = args.width or options.width if type(width) == 'function' then width = width(match) + elseif Logic.isNumeric(width) then + width = width .. 'px' end return MatchSummaryWidgets.Container{