From 1430c229db554b8db901903f7797fbeb7958b1cf Mon Sep 17 00:00:00 2001 From: tligui_y Date: Thu, 17 Jul 2025 15:26:13 +0200 Subject: [PATCH] Update json_to_md.py --- json_to_md.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/json_to_md.py b/json_to_md.py index 02ab7af1..ca2688e2 100644 --- a/json_to_md.py +++ b/json_to_md.py @@ -17,16 +17,17 @@ def stringify(obj, indent=0): elif isinstance(obj, (int, float, str, bool)): return str(obj) elif isinstance(obj, list): - 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) elif isinstance(obj, dict): return '\n'.join(f"{space}{k}: {stringify(v, indent + 1)}" for k, v in obj.items()) - elif hasattr(obj, '__str__'): + elif isinstance(obj, object) and str(obj).startswith("" + else: try: return str(obj) except: - return repr(obj) - else: - return repr(obj) + return "" + def normalize_nodeid(nodeid):