refac: styling

This commit is contained in:
Timothy Jaeryang Baek 2025-07-09 00:05:59 +04:00
parent 248fd10406
commit 40a715be89
2 changed files with 22 additions and 13 deletions

View file

@ -220,12 +220,12 @@
{/each} {/each}
</ol> </ol>
{:else} {:else}
<ul dir="auto"> <ul dir="auto" class="">
{#each token.items as item, itemIdx} {#each token.items as item, itemIdx}
<li class="text-start"> <li class="text-start {item?.task ? 'flex -translate-x-7 gap-3.5 ' : ''}">
{#if item?.task} {#if item?.task}
<input <input
class=" translate-y-[1px] -translate-x-1" class=""
type="checkbox" type="checkbox"
checked={item.checked} checked={item.checked}
on:change={(e) => { on:change={(e) => {
@ -239,15 +239,25 @@
}); });
}} }}
/> />
{/if}
<svelte:self <div>
id={`${id}-${tokenIdx}-${itemIdx}`} <svelte:self
tokens={item.tokens} id={`${id}-${tokenIdx}-${itemIdx}`}
top={token.loose} tokens={item.tokens}
{onTaskClick} top={token.loose}
{onSourceClick} {onTaskClick}
/> {onSourceClick}
/>
</div>
{:else}
<svelte:self
id={`${id}-${tokenIdx}-${itemIdx}`}
tokens={item.tokens}
top={token.loose}
{onTaskClick}
{onSourceClick}
/>
{/if}
</li> </li>
{/each} {/each}
</ul> </ul>

View file

@ -484,7 +484,6 @@
const htmlValue = editor.getHTML(); const htmlValue = editor.getHTML();
const jsonValue = editor.getJSON(); const jsonValue = editor.getJSON();
console.log(htmlValue, jsonValue);
let mdValue = turndownService let mdValue = turndownService
.turndown( .turndown(
htmlValue htmlValue
@ -578,7 +577,7 @@
} }
const isInCodeBlock = isInside(['codeBlock']); const isInCodeBlock = isInside(['codeBlock']);
const isInList = isInside(['listItem', 'bulletList', 'orderedList']); const isInList = isInside(['listItem', 'bulletList', 'orderedList', 'taskList']);
const isInHeading = isInside(['heading']); const isInHeading = isInside(['heading']);
if (isInCodeBlock || isInList || isInHeading) { if (isInCodeBlock || isInList || isInHeading) {