Skip to content

Commit

Permalink
Only append nonempty tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
Wesley Chalmers committed Oct 16, 2020
1 parent e48e1e5 commit 15960bf
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ def process_color_codes(raw_desc):
if char != "§":
token += char
else:
description.append({
"text": token,
**params
})
if token:
description.append({
"text": token,
**params
})
token = ""

code = next(desc_iter)
Expand All @@ -73,10 +74,11 @@ def process_color_codes(raw_desc):
except StopIteration:
pass

description.append({
"text": token,
**params
})
if token:
description.append({
"text": token,
**params
})

return description

Expand Down

0 comments on commit 15960bf

Please sign in to comment.