From 8363159bf4abdd00ae6a566c8a8d2b34c5cd543e Mon Sep 17 00:00:00 2001 From: tligui_y Date: Thu, 17 Jul 2025 15:56:49 +0200 Subject: [PATCH] Update json_to_md.py --- json_to_md.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/json_to_md.py b/json_to_md.py index 89a3780a..facf0d0f 100644 --- a/json_to_md.py +++ b/json_to_md.py @@ -17,14 +17,20 @@ def stringify(obj, indent=0): if isinstance(obj, list): if not obj: return "[]" - return '\n'.join(f"{space}- {stringify(e, indent + 1)}" for e in obj) + return '\n'.join(f"{space} {stringify(e, indent + 1)}" for e in obj) if isinstance(obj, dict): if not obj: return "{}" - return '\n'.join(f"{space}{k}: {stringify(v, indent + 1)}" for k, v in obj.items()) + lines = [] + for k, v in obj.items(): + v_str = stringify(v, indent + 1) + # on force retour à la ligne après la clé + lines.append(f"{space}{k}:\n{v_str}") + return '\n'.join(lines) + + return f"{space}{str(obj)}" - return str(obj) def sanitize_param_value(v): s = str(v)