From e4f29e05de5cf7234619dc90da075ad42d8aedc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=BB?= Date: Thu, 28 Oct 2021 12:14:41 +0200 Subject: [PATCH 1/2] Fix broken layout rendering in `qmk info` by '\n' --- lib/python/qmk/info.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index 350e5e2178f9..2a9c4e2abbbe 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -99,6 +99,12 @@ def info_json(keyboard): # Check that the reported matrix size is consistent with the actual matrix size _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'].replace('\n', '') + return info_data From 512c3536697b4a4e7ae6d1edc6b0da064e3b4484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=BB?= Date: Sat, 30 Oct 2021 17:43:49 +0200 Subject: [PATCH 2/2] Add requested changes --- lib/python/qmk/info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index 2a9c4e2abbbe..85131b9299d4 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -103,7 +103,7 @@ def info_json(keyboard): for layout_name, layout_json in layouts.items(): for key in layout_json['layout']: if '\n' in key['label']: - key['label'] = key['label'].replace('\n', '') + key['label'] = key['label'].split('\n')[0] return info_data