Skip to content

Commit

Permalink
Keep line breaks for TreeViewItemContent
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Feb 13, 2024
1 parent 04f7138 commit ed5fce3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@
</a>
</span>
{:else}
{content}
<p class="max-w-[65ch] whitespace-pre-line">
{content}
</p>
{/if}
</span>
{#if (threats && threats.length > 0) || (security_functions && security_functions.length > 0)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,26 @@
</script>

<div>
<span style="font-weight: {hasChildren ? 600 : 300};">
{content}
<span class="whitespace-pre-line" style="font-weight: {hasChildren ? 600 : 300};">
<p class="max-w-[65ch]">
{content}
</p>
</span>
{#if (threats && threats.length > 0) || (security_functions && security_functions.length > 0)}
<div
role="button"
tabindex="0"
class="underline text-sm hover:text-primary-400 {classesShowInfoText(showInfo)}"
on:click={(_) => (showInfo = !showInfo)}
on:keydown={(_) => (showInfo = !showInfo)}
on:click={(e) => {
e.preventDefault();
showInfo = !showInfo;
}}
on:keydown={(e) => {
if (e.key === 'Enter') {
e.preventDefault();
showInfo = !showInfo;
}
}}
>
<i class="text-xs fa-solid fa-info-circle" /> Learn more
</div>
Expand Down

0 comments on commit ed5fce3

Please sign in to comment.