Skip to content

Commit 038a04f

Browse files
committed
docs(changeset): fix(list): restart ordered lists at 1. instead of continuing numbering across lists
1 parent 5c0ed3d commit 038a04f

File tree

5 files changed

+44
-2
lines changed

5 files changed

+44
-2
lines changed

.changeset/large-geckos-love.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@m2d/list": patch
3+
---
4+
5+
fix(list): restart ordered lists at `1.` instead of continuing numbering across lists

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
"editor.formatOnPaste": true,
1515
"editor.formatOnSaveMode": "file",
1616
"mayank1513.trello-kanban.Workspace.filePath": ".tkb",
17-
"cSpell.words": ["mdast", "Turborepo"]
17+
"cSpell.words": ["mdast", "Turborepo"],
18+
"[typescript]": {
19+
"editor.defaultFormatter": "biomejs.biome"
20+
}
1821
}

lib/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ export const listPlugin: (options?: IListPluginOptions) => IPlugin = (
108108
...options,
109109
} as IDefaultListPluginOptions;
110110

111+
let instance = 0;
112+
111113
return {
112114
/**
113115
* Processes block-level list nodes.
@@ -128,6 +130,7 @@ export const listPlugin: (options?: IListPluginOptions) => IPlugin = (
128130
: {
129131
level,
130132
reference: node.ordered ? numReference : bulletReference,
133+
instance: instance++,
131134
};
132135

133136
paraProps.bullet = { level };

packages/shared/src/server/landing-page/landing-page.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
}
4343

4444
.hero {
45+
height: 300px;
4546
h2,
4647
strong {
4748
font-style: italic;

sample.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ tags: [mdast, markdown, reference]
99

1010
# Markdown Syntax Showcase
1111

12-
## 2. Lists
12+
## Lists
1313

1414
# Nested Lists in Markdown
1515

@@ -31,6 +31,36 @@ tags: [mdast, markdown, reference]
3131

3232
## Ordered Nested List
3333

34+
1. Morning Routine
35+
1. Wake up
36+
2. Brush teeth
37+
3. Exercise
38+
1. Yoga
39+
2. Running
40+
2. Work Tasks
41+
1. Check emails
42+
2. Daily stand-up
43+
3. Coding
44+
1. Feature development
45+
2. Code review
46+
47+
### Another list
48+
49+
1. Morning Routine
50+
1. Wake up
51+
2. Brush teeth
52+
3. Exercise
53+
1. Yoga
54+
2. Running
55+
2. Work Tasks
56+
1. Check emails
57+
2. Daily stand-up
58+
3. Coding
59+
1. Feature development
60+
2. Code review
61+
62+
### Yet Another list
63+
3464
1. Morning Routine
3565
1. Wake up
3666
2. Brush teeth

0 commit comments

Comments
 (0)