Skip to content

Commit 5f7c61f

Browse files
committed
fix(files): apply task-list styling to ordered lists too
1 parent 5721f70 commit 5f7c61f

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/preview-panel.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,6 @@ const STATIC_MARKDOWN_COMPONENTS = {
9696
{children}
9797
</h4>
9898
),
99-
ol: ({ children }: any) => (
100-
<ol className='mt-1 mb-3 list-decimal space-y-1 break-words pl-6 text-[14px] text-[var(--text-primary)]'>
101-
{children}
102-
</ol>
103-
),
10499
code: ({ inline, className, children, ...props }: any) => {
105100
const isInline = inline || !className?.includes('language-')
106101

@@ -189,6 +184,19 @@ function buildMarkdownComponents(
189184
</ul>
190185
)
191186
},
187+
ol: ({ className, children }: any) => {
188+
const isTaskList = typeof className === 'string' && className.includes('contains-task-list')
189+
return (
190+
<ol
191+
className={cn(
192+
'mt-1 mb-3 space-y-1 break-words text-[14px] text-[var(--text-primary)]',
193+
isTaskList ? 'list-none pl-0' : 'list-decimal pl-6'
194+
)}
195+
>
196+
{children}
197+
</ol>
198+
)
199+
},
192200
li: ({ className, children }: any) => {
193201
const isTaskItem = typeof className === 'string' && className.includes('task-list-item')
194202
if (isTaskItem) {

0 commit comments

Comments
 (0)