Skip to content

Commit

Permalink
Fixup actions. (qmk#15057)
Browse files Browse the repository at this point in the history
  • Loading branch information
tzarc authored Nov 4, 2021
1 parent c8b09d0 commit c8da633
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/python/qmk/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ def _valid_community_layout(layout):
return (Path('layouts/default') / layout).exists()


def _remove_newlines_from_labels(layouts):
for layout_name, layout_json in layouts.items():
for key in layout_json['layout']:
if '\n' in key['label']:
key['label'] = key['label'].split('\n')[0]


def info_json(keyboard):
"""Generate the info.json data for a specific keyboard.
"""
Expand Down Expand Up @@ -100,10 +107,7 @@ def info_json(keyboard):
_check_matrix(info_data)

# Remove newline characters from layout labels
for layout_name, layout_json in layouts.items():
for key in layout_json['layout']:
if '\n' in key['label']:
key['label'] = key['label'].split('\n')[0]
_remove_newlines_from_labels(layouts)

return info_data

Expand Down

0 comments on commit c8da633

Please sign in to comment.