diff --git a/inception/inception-diam-editor/src/main/ts/src/SpanText.svelte b/inception/inception-diam-editor/src/main/ts/src/SpanText.svelte index 0d1aa4f089b..7ee2255303f 100644 --- a/inception/inception-diam-editor/src/main/ts/src/SpanText.svelte +++ b/inception/inception-diam-editor/src/main/ts/src/SpanText.svelte @@ -24,13 +24,15 @@ $: begin = span.offsets[0][0] $: end = span.offsets[0][1] - $: text = data.text.substring(begin, end).trim() + $: text = data.text.substring(begin, end).trim().replace(/\s+/g, ' ') {#if text.length === 0} (empty span) +{:else if text.length > 50} +{text.substring(0, 50)} {:else} -{text.substring(0, 50)+(text.length > 50 ? '…' : '')} +{text} {/if}