mirror of
https://github.com/mt-mods/pipeworks.git
synced 2025-07-04 17:20:35 +02:00
item_transport.lua: use string:trim() method.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
@ -10,7 +10,7 @@ if pipeworks.enable_item_tags then
|
||||
pipeworks.safe_tag = function(tag)
|
||||
if tag == nil or type(tag) ~= "string" or tag == "" then return nil end
|
||||
tag = tag:gsub(",", "_") -- replace commas with underscores
|
||||
tag = tag:match("^%s*(.-)%s*$") -- trim leading and trailing spaces
|
||||
tag = tag:trim() -- trim leading and trailing spaces
|
||||
return tag:sub(1, item_tag_name_limit)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user