Skip to content

Commit

Permalink
Use JSON for table values only for objects
Browse files Browse the repository at this point in the history
Without this numbers are treated as json, which styles them with an offset.

Signed-off-by: Ivan Babrou <github@ivan.computer>
  • Loading branch information
bobrik committed Feb 16, 2024
1 parent a150319 commit 0187d1c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,9 @@ function formatValue(key: string, value: any) {
parsed = tryParseJson(value);
}

if (typeof parsed === 'string') {
content = stringMarkup(parsed);
} else if (Array.isArray(parsed) && shouldDisplayAsStringList(key)) {
if (Array.isArray(parsed) && shouldDisplayAsStringList(key)) {
content = stringListMarkup(parsed);
} else {
} else if (typeof parsed == 'object') {
const shouldJsonTreeExpand = Object.keys(parsed).length <= 10;

content = (
Expand All @@ -95,6 +93,8 @@ function formatValue(key: string, value: any) {
}}
/>
);
} else {
content = stringMarkup(parsed);
}

return <div className="ub-inline-block">{content}</div>;
Expand Down

0 comments on commit 0187d1c

Please sign in to comment.