mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-03 03:37:28 +01:00
Fix short_description being cut when not needed
This commit is contained in:
parent
031c3c4684
commit
e5de270e65
@ -235,9 +235,12 @@ class PackageTreeNode:
|
|||||||
# Calculate short description
|
# Calculate short description
|
||||||
if "description" in result:
|
if "description" in result:
|
||||||
desc = result["description"]
|
desc = result["description"]
|
||||||
idx = desc.find(".") + 1
|
if len(desc) > 200:
|
||||||
cutIdx = min(len(desc), 200 if idx < 5 else idx)
|
idx = desc.find(".") + 1
|
||||||
result["short_description"] = desc[:cutIdx]
|
idx = min(len(desc), 200 if idx < 5 else idx)
|
||||||
|
result["short_description"] = desc[:idx]
|
||||||
|
else:
|
||||||
|
result["short_description"] = desc
|
||||||
|
|
||||||
if "name" in result:
|
if "name" in result:
|
||||||
self.name = result["name"]
|
self.name = result["name"]
|
||||||
|
Loading…
Reference in New Issue
Block a user