refac
This commit is contained in:
1 parent
6ffce4bccd
commit
6719558150
2 files changed
+21
-2
No files matched your search
@@ -54,7 +54,9 @@
|
||||
console.log('Exporting table to CSV');
|
||||
|
||||
// Extract header row text, decode HTML entities, and escape for CSV.
|
||||
const header = token.header.map((headerCell) => `"${decode(headerCell.text).replace(/"/g, '""')}"`);
|
||||
const header = token.header.map(
|
||||
(headerCell) => `"${decode(headerCell.text).replace(/"/g, '""')}"`
|
||||
);
|
||||
|
||||
// Create an array for rows that will hold the mapped cell text.
|
||||
const rows = token.rows.map((row) =>
|
||||
@@ -316,6 +318,11 @@
|
||||
</ul>
|
||||
{/if}
|
||||
{:else if token.type === 'details'}
|
||||
{@const textContent = decode(token.text || '')
|
||||
.replace(/<summary>.*?<\/summary>/gi, '')
|
||||
.trim()}
|
||||
|
||||
{#if textContent.length > 0}
|
||||
<Collapsible
|
||||
title={token.summary}
|
||||
open={$settings?.expandDetails ?? false}
|
||||
@@ -336,6 +343,16 @@
|
||||
/>
|
||||
</div>
|
||||
</Collapsible>
|
||||
{:else}
|
||||
<Collapsible
|
||||
title={token.summary}
|
||||
open={false}
|
||||
disabled={true}
|
||||
attributes={token?.attributes}
|
||||
className="w-full space-y-1"
|
||||
dir="auto"
|
||||
/>
|
||||
{/if}
|
||||
{:else if token.type === 'html'}
|
||||
<HtmlToken {id} {token} {onSourceClick} />
|
||||
{:else if token.type === 'iframe'}
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<div
|
||||
class="{buttonClassName} cursor-pointer"
|
||||
class="{buttonClassName} {disabled ? '' : 'cursor-pointer'}"
|
||||
on:pointerup={() => {
|
||||
if (!disabled) {
|
||||
open = !open;
|
||||
@@ -270,6 +270,7 @@
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{#if !disabled}
|
||||
<div class="flex self-center translate-y-[1px]">
|
||||
{#if open}
|
||||
<ChevronUp strokeWidth="3.5" className="size-3.5" />
|
||||
@@ -277,6 +278,7 @@
|
||||
<ChevronDown strokeWidth="3.5" className="size-3.5" />
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
|
||||
Reference in new issue
Block a user