diff --git a/frontend/.prettierrc b/frontend/.prettierrc index b1dc1d659e..ac57ae142f 100644 --- a/frontend/.prettierrc +++ b/frontend/.prettierrc @@ -3,5 +3,6 @@ "singleQuote": true, "trailingComma": "none", "printWidth": 100, + "htmlWhitespaceSensitivity": "strict", "semi": false } diff --git a/frontend/src/app.css b/frontend/src/app.css index d5992cf075..a0bb14980c 100644 --- a/frontend/src/app.css +++ b/frontend/src/app.css @@ -21,7 +21,7 @@ html { a { @apply text-blue-500; } - + .flex pre code.hljs { @apply text-sm; } @@ -127,19 +127,19 @@ html { @apply rounded-lg; @apply text-sm; @apply px-5; - @apply py-2.5; - @apply text-center; + @apply py-2.5; + @apply text-center; @apply inline-flex; @apply items-center; } .default-primary-button-v2:focus { - @apply ring-4; + @apply ring-4; @apply outline-none; @apply bg-blue-800; } .default-primary-button-v2:hover { - @apply bg-blue-800 + @apply bg-blue-800; } .default-secondary-button-v2 { @@ -151,19 +151,19 @@ html { @apply rounded-lg; @apply text-sm; @apply px-5; - @apply py-2.5; - @apply text-center; + @apply py-2.5; + @apply text-center; @apply inline-flex; @apply items-center; } .default-secondary-button-v2:focus { - @apply ring-4; + @apply ring-4; @apply outline-none; @apply ring-gray-100; } .default-secondary-button-v2:hover { - @apply bg-gray-100 + @apply bg-gray-100; } .input-error { @@ -224,10 +224,10 @@ html { .inline-highlight pre code.hljs { padding: 0; - @apply text-xs; + @apply text-xs whitespace-pre-wrap; } /* svelte-split-pane separator class override */ .separator { background-color: #ddd !important; -} \ No newline at end of file +} diff --git a/frontend/src/lib/components/DisplayResult.svelte b/frontend/src/lib/components/DisplayResult.svelte index 8dc6a124eb..bb7af9a5bf 100644 --- a/frontend/src/lib/components/DisplayResult.svelte +++ b/frontend/src/lib/components/DisplayResult.svelte @@ -6,8 +6,18 @@ export let result: any - let resultKind: 'json' | 'table-col' | 'table-row' | 'png' | 'file' | 'jpeg' | 'gif' | undefined = - inferResultKind(result) + let resultKind: + | 'json' + | 'table-col' + | 'table-row' + | 'png' + | 'file' + | 'jpeg' + | 'gif' + | 'error' + | undefined = inferResultKind(result) + + let forceJson = false function isRectangularArray(obj: any) { if (!Array.isArray(obj) || obj.length == 0) { @@ -45,6 +55,8 @@ return 'jpeg' } else if (keys.length == 1 && keys[0] == 'file') { return 'file' + } else if (keys.length == 1 && keys[0] == 'error') { + return 'error' } } catch (err) {} } @@ -52,13 +64,17 @@ } -
+ {:else if !forceJson && resultKind == 'png'}
+
+ {:else if !forceJson && resultKind == 'gif'}
+
{result.error}
+