From ea1c4cea287706addf53944d8080408f99eb8c17 Mon Sep 17 00:00:00 2001 From: dribble-njr Date: Fri, 6 Dec 2024 13:07:31 +0800 Subject: [PATCH 1/3] style: optimize listitem style --- src/config/theme.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config/theme.ts b/src/config/theme.ts index d4934cad4..4ba98079b 100644 --- a/src/config/theme.ts +++ b/src/config/theme.ts @@ -216,7 +216,8 @@ const defaultTheme: Theme = { inline: { listitem: { 'text-indent': `-1em`, - 'display': `block`, + 'display': `flex`, + 'align-items': `center`, 'margin': `0.2em 8px`, 'color': `var(--el-text-color-regular)`, }, From 31dc2478f6587cf42e34b214660a1f1945acb617 Mon Sep 17 00:00:00 2001 From: dribble-njr Date: Fri, 6 Dec 2024 13:16:19 +0800 Subject: [PATCH 2/3] fix: correct ordered list start number rendering --- src/utils/renderer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/renderer.ts b/src/utils/renderer.ts index 4127c0d48..2801ea28c 100644 --- a/src/utils/renderer.ts +++ b/src/utils/renderer.ts @@ -193,11 +193,11 @@ export function initRenderer(opts: IOpts) { return styledContent(`listitem`, `${prefix}${content}`, `li`) }, - list({ ordered, items }: Tokens.List): string { + list({ ordered, items, start = 1 }: Tokens.List): string { const listItems = [] for (let i = 0; i < items.length; i++) { isOrdered = ordered - listIndex = i + listIndex = Number(start) + i - 1 const item = items[i] listItems.push(this.listitem(item)) } From bd1e04029429b6e6c9160e49c1950fb05d3715cf Mon Sep 17 00:00:00 2001 From: dribble-njr Date: Fri, 6 Dec 2024 16:20:23 +0800 Subject: [PATCH 3/3] style: revert listitem style --- src/config/theme.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/config/theme.ts b/src/config/theme.ts index 4ba98079b..d4934cad4 100644 --- a/src/config/theme.ts +++ b/src/config/theme.ts @@ -216,8 +216,7 @@ const defaultTheme: Theme = { inline: { listitem: { 'text-indent': `-1em`, - 'display': `flex`, - 'align-items': `center`, + 'display': `block`, 'margin': `0.2em 8px`, 'color': `var(--el-text-color-regular)`, },