We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 659064f commit db96f8eCopy full SHA for db96f8e
1 file changed
elementary/utils/json_utils.py
@@ -151,11 +151,13 @@ def list_of_dicts_to_markdown_table(
151
if len(table) <= effective_max:
152
return table + truncation_note
153
154
- # Even a single row doesn't fit — return what we can with a note
+ # Even a single row doesn't fit — hard-truncate and append note
155
single_row_table = tabulate(
156
processed_data[:1],
157
headers="keys",
158
tablefmt="github",
159
disable_numparse=True,
160
)
161
- return single_row_table + truncation_note
+ if effective_max <= 0 or len(single_row_table) <= effective_max:
162
+ return single_row_table + truncation_note
163
+ return single_row_table[:effective_max].rstrip() + truncation_note
0 commit comments