Skip to content

Commit f98c7ff

Browse files
committed
fix: checkbox position
1 parent 457d6c6 commit f98c7ff

File tree

3 files changed

+57
-8
lines changed

3 files changed

+57
-8
lines changed

src/components/ui/markdown/Markdown.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ export const Markdown: FC<MdProps & MarkdownToJSX.Options & PropsWithChildren> =
116116
gfmTask: {
117117
react(node, _, state) {
118118
return (
119-
<label
120-
className="mr-2 inline-flex items-center"
119+
<input
120+
type="checkbox"
121121
key={state?.key}
122-
>
123-
<input type="checkbox" checked={node.completed} readOnly />
124-
</label>
122+
checked={node.completed}
123+
readOnly
124+
/>
125125
)
126126
},
127127
},

src/components/ui/markdown/customize.md

+51-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,55 @@
1-
## Basic
1+
## List and GFM Tasks
22

3-
### Table
3+
1. First
4+
2. Second
5+
1. 2.1
6+
2. 2.2
7+
1. 3.1
8+
3. Third
9+
4. Fourth
10+
11+
- [ ] Checkbox
12+
- [x] Checkbox Completed
13+
14+
---
15+
16+
- Line
17+
- Line 1.1
18+
- Line 2
19+
20+
## Definition lists
21+
22+
Term 1
23+
24+
: Definition 1
25+
with lazy continuation.
26+
27+
Term 2 with _inline markup_
28+
29+
: Definition 2
30+
31+
{ some code, part of Definition 2 }
32+
33+
Third paragraph of definition 2.
34+
35+
_Compact style:_
36+
37+
Term 1
38+
~ Definition 1
39+
40+
Term 2
41+
~ Definition 2a
42+
~ Definition 2b
43+
44+
## [Abbreviations](https://github.com/markdown-it/markdown-it-abbr)
45+
46+
This is HTML abbreviation example.
47+
48+
It converts "HTML", but keep intact partial entries like "xxxHTMLyyy" and so on.
49+
50+
\*[HTML]: Hyper Text Markup Language
51+
52+
## Table
453

554
| 表达内容 | 示例 |
655
| ---------------------------------------------------------------------------------------------------------------------------------------- | ------------- |

src/components/ui/markdown/markdown.module.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
}
8888

8989
input[type='checkbox'] {
90-
@apply checkbox;
90+
@apply checkbox checkbox-xs my-0 mr-2 align-text-bottom;
9191
}
9292

9393
input[type='checkbox']:disabled,

0 commit comments

Comments
 (0)