Crafting: Strip newlines from item descriptions
This commit is contained in:
parent
ceac579c3a
commit
8a7dc21b9e
@ -318,7 +318,14 @@ function crafting.get_formspec(name)
|
||||
craft_list = craft_list .. minetest.formspec_escape(itemstack:get_count())
|
||||
end
|
||||
|
||||
craft_list = craft_list .. "," .. minetest.formspec_escape(itemdef.description)
|
||||
local desc = itemdef.description
|
||||
-- Cut off item description after first newline
|
||||
local firstnewline = string.find(desc, "\n")
|
||||
if firstnewline then
|
||||
desc = string.sub(desc, 1, firstnewline-1)
|
||||
end
|
||||
|
||||
craft_list = craft_list .. "," .. minetest.formspec_escape(desc)
|
||||
craft_count = craft_count + 1
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user