Skip to content

Commit 30c0ae8

Browse files
committed
feat: improve GFM syntax and React support
1 parent 2aadfc7 commit 30c0ae8

38 files changed

Lines changed: 3460 additions & 617 deletions

SPEC/GFM/task-list.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
timeout:
3+
parse: 50ms
4+
html: 5ms
5+
markdown: 5ms
6+
---
7+
8+
## Input
9+
10+
```md
11+
- [x] Done
12+
- [ ] todo
13+
```
14+
15+
## AST
16+
17+
```json
18+
{
19+
"type": "minimark",
20+
"value": [
21+
[
22+
"ul",
23+
{
24+
"class": "contains-task-list"
25+
},
26+
[
27+
"li",
28+
{
29+
"class": "task-list-item"
30+
},
31+
[
32+
"input",
33+
{
34+
"class": "task-list-item-checkbox",
35+
":checked": "true",
36+
":disabled": "true",
37+
"type": "checkbox"
38+
}
39+
],
40+
" Done"
41+
],
42+
[
43+
"li",
44+
{
45+
"class": "task-list-item"
46+
},
47+
[
48+
"input",
49+
{
50+
"class": "task-list-item-checkbox",
51+
":disabled": "true",
52+
"type": "checkbox"
53+
}
54+
],
55+
" todo"
56+
]
57+
]
58+
]
59+
}
60+
```
61+
62+
## HTML
63+
64+
```html
65+
<ul class="contains-task-list">
66+
<li class="task-list-item">
67+
<input class="task-list-item-checkbox" checked disabled type="checkbox" /> Done
68+
</li>
69+
<li class="task-list-item">
70+
<input class="task-list-item-checkbox" disabled type="checkbox" /> todo
71+
</li>
72+
</ul>
73+
```
74+
75+
## Markdown
76+
77+
```md
78+
- [x] Done
79+
- [ ] todo
80+
```

SPEC/MDC/cjk.md

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
## Input
2+
3+
```md
4+
# CJK Language Support
5+
6+
MDC properly handles emphasis in Chinese, Japanese, and Korean text, even with ideographic punctuation.
7+
8+
## Japanese
9+
10+
Standard markdown breaks with ideographic punctuation:
11+
12+
**この文は太字になります(This sentence will be bolded)。**この文が後に続いても大丈夫です。
13+
14+
*斜体のテキスト【補足情報】。*この文が後に続いても大丈夫です。
15+
16+
~~削除されたテキスト(古い情報)。~~この文は正しいです。
17+
18+
## Chinese
19+
20+
Works seamlessly with Chinese punctuation:
21+
22+
**重要提示(Important Notice):**请注意。
23+
24+
*这是斜体文字(带括号)。*这句子继续也没问题。
25+
26+
~~旧方法(已废弃)。~~这个句子是正确的。
27+
28+
## Korean
29+
30+
Korean text with mixed punctuation:
31+
32+
**한국어 구문(괄호 포함)**을 강조.
33+
34+
*이 텍스트(괄호 포함)*는 기울임꼴입니다.
35+
36+
~~이 텍스트(괄호 포함)~~를 삭제합니다.
37+
```
38+
39+
## AST
40+
41+
```json
42+
{
43+
"type": "minimark",
44+
"value": [
45+
[
46+
"h1",
47+
{
48+
"id": "cjk-language-support"
49+
},
50+
"CJK Language Support"
51+
],
52+
[
53+
"p",
54+
{},
55+
"MDC properly handles emphasis in Chinese, Japanese, and Korean text, even with ideographic punctuation."
56+
],
57+
[
58+
"h2",
59+
{
60+
"id": "japanese"
61+
},
62+
"Japanese"
63+
],
64+
[
65+
"p",
66+
{},
67+
"Standard markdown breaks with ideographic punctuation:"
68+
],
69+
[
70+
"p",
71+
{},
72+
[
73+
"strong",
74+
{},
75+
"この文は太字になります(This sentence will be bolded)。"
76+
],
77+
"この文が後に続いても大丈夫です。"
78+
],
79+
[
80+
"p",
81+
{},
82+
[
83+
"em",
84+
{},
85+
"斜体のテキスト【補足情報】。"
86+
],
87+
"この文が後に続いても大丈夫です。"
88+
],
89+
[
90+
"p",
91+
{},
92+
[
93+
"del",
94+
{},
95+
"削除されたテキスト(古い情報)。"
96+
],
97+
"この文は正しいです。"
98+
],
99+
[
100+
"h2",
101+
{
102+
"id": "chinese"
103+
},
104+
"Chinese"
105+
],
106+
[
107+
"p",
108+
{},
109+
"Works seamlessly with Chinese punctuation:"
110+
],
111+
[
112+
"p",
113+
{},
114+
[
115+
"strong",
116+
{},
117+
"重要提示(Important Notice):"
118+
],
119+
"请注意。"
120+
],
121+
[
122+
"p",
123+
{},
124+
[
125+
"em",
126+
{},
127+
"这是斜体文字(带括号)。"
128+
],
129+
"这句子继续也没问题。"
130+
],
131+
[
132+
"p",
133+
{},
134+
[
135+
"del",
136+
{},
137+
"旧方法(已废弃)。"
138+
],
139+
"这个句子是正确的。"
140+
],
141+
[
142+
"h2",
143+
{
144+
"id": "korean"
145+
},
146+
"Korean"
147+
],
148+
[
149+
"p",
150+
{},
151+
"Korean text with mixed punctuation:"
152+
],
153+
[
154+
"p",
155+
{},
156+
[
157+
"strong",
158+
{},
159+
"한국어 구문(괄호 포함)"
160+
],
161+
"을 강조."
162+
],
163+
[
164+
"p",
165+
{},
166+
[
167+
"em",
168+
{},
169+
"이 텍스트(괄호 포함)"
170+
],
171+
"는 기울임꼴입니다."
172+
],
173+
[
174+
"p",
175+
{},
176+
[
177+
"del",
178+
{},
179+
"이 텍스트(괄호 포함)"
180+
],
181+
"를 삭제합니다."
182+
]
183+
]
184+
}
185+
```
186+
187+
## HTML
188+
189+
```html
190+
<h1 id="cjk-language-support">CJK Language Support</h1>
191+
<p>MDC properly handles emphasis in Chinese, Japanese, and Korean text, even with ideographic punctuation.</p>
192+
<h2 id="japanese">Japanese</h2>
193+
<p>Standard markdown breaks with ideographic punctuation:</p>
194+
<p><strong>この文は太字になります(This sentence will be bolded)。</strong>この文が後に続いても大丈夫です。</p>
195+
<p><em>斜体のテキスト【補足情報】。</em>この文が後に続いても大丈夫です。</p>
196+
<p>
197+
<del>
198+
削除されたテキスト(古い情報)。
199+
</del>この文は正しいです。
200+
</p>
201+
<h2 id="chinese">Chinese</h2>
202+
<p>Works seamlessly with Chinese punctuation:</p>
203+
<p><strong>重要提示(Important Notice):</strong>请注意。</p>
204+
<p><em>这是斜体文字(带括号)。</em>这句子继续也没问题。</p>
205+
<p>
206+
<del>
207+
旧方法(已废弃)。
208+
</del>这个句子是正确的。
209+
</p>
210+
<h2 id="korean">Korean</h2>
211+
<p>Korean text with mixed punctuation:</p>
212+
<p><strong>한국어 구문(괄호 포함)</strong>을 강조.</p>
213+
<p><em>이 텍스트(괄호 포함)</em>는 기울임꼴입니다.</p>
214+
<p>
215+
<del>
216+
이 텍스트(괄호 포함)
217+
</del>를 삭제합니다.
218+
</p>
219+
```
220+
221+
## Markdown
222+
223+
```md
224+
# CJK Language Support
225+
226+
MDC properly handles emphasis in Chinese, Japanese, and Korean text, even with ideographic punctuation.
227+
228+
## Japanese
229+
230+
Standard markdown breaks with ideographic punctuation:
231+
232+
**この文は太字になります(This sentence will be bolded)。**この文が後に続いても大丈夫です。
233+
234+
*斜体のテキスト【補足情報】。*この文が後に続いても大丈夫です。
235+
236+
~~削除されたテキスト(古い情報)。~~この文は正しいです。
237+
238+
## Chinese
239+
240+
Works seamlessly with Chinese punctuation:
241+
242+
**重要提示(Important Notice):**请注意。
243+
244+
*这是斜体文字(带括号)。*这句子继续也没问题。
245+
246+
~~旧方法(已废弃)。~~这个句子是正确的。
247+
248+
## Korean
249+
250+
Korean text with mixed punctuation:
251+
252+
**한국어 구문(괄호 포함)**을 강조.
253+
254+
*이 텍스트(괄호 포함)*는 기울임꼴입니다.
255+
256+
~~이 텍스트(괄호 포함)~~를 삭제합니다.
257+
```

build.config.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,11 @@ export default defineBuildConfig({
1111
input: './src/vue',
1212
outDir: './dist/vue',
1313
},
14+
{
15+
type: 'bundle',
16+
input: './src/react/index.ts',
17+
outDir: './dist',
18+
name: 'react/index',
19+
},
1420
],
1521
})

examples/react-vite/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

0 commit comments

Comments
 (0)