File tree 3 files changed +10
-4
lines changed
3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 6
6
7
7
By default, Slidev enables the following presets out-of-box:
8
8
9
- - [ @unocss/preset-uno ] ( https://unocss.dev/presets/uno ) - Tailwind / Windi CSS compatible utilities
9
+ - [ @unocss/preset-wind3 ] ( https://unocss.dev/presets/wind3 ) - Tailwind / Windi CSS compatible utilities
10
10
- [ @unocss/preset-attributify ] ( https://unocss.dev/presets/attributify ) - Attributify mode
11
11
- [ @unocss/preset-icons ] ( https://unocss.dev/presets/icons ) - Use any icons as class
12
12
- [ @unocss/preset-web-fonts ] ( https://unocss.dev/presets/web-fonts ) - Use web fonts at ease
Original file line number Diff line number Diff line change @@ -148,6 +148,12 @@ export async function parse(
148
148
const newContent = await e . transformSlide ( slide . content , slide . frontmatter )
149
149
if ( newContent !== undefined )
150
150
slide . content = newContent
151
+ if ( typeof slide . frontmatter . title === 'string' ) {
152
+ slide . title = slide . frontmatter . title
153
+ }
154
+ if ( typeof slide . frontmatter . level === 'number' ) {
155
+ slide . level = slide . frontmatter . level
156
+ }
151
157
}
152
158
}
153
159
}
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ describe('utils', () => {
109
109
}
110
110
111
111
const slide1 = createFakeSource ( `` )
112
- updateFrontmatterPatch ( slide1 , { dragPos } )
112
+ updateFrontmatterPatch ( slide1 . source , { dragPos } )
113
113
expectFrontmatter ( slide1 ) . toMatchInlineSnapshot ( `
114
114
"dragPos:
115
115
foo: 1,2,3,4
@@ -122,7 +122,7 @@ describe('utils', () => {
122
122
dragPos:
123
123
bar: 5,6,7,8
124
124
` )
125
- updateFrontmatterPatch ( slide2 , { dragPos } )
125
+ updateFrontmatterPatch ( slide2 . source , { dragPos } )
126
126
expectFrontmatter ( slide2 ) . toMatchInlineSnapshot ( `
127
127
"# comment
128
128
title: Hello # another comment
@@ -138,7 +138,7 @@ describe('utils', () => {
138
138
dragPos:
139
139
bar: 5,6,7,8
140
140
` )
141
- updateFrontmatterPatch ( slide3 , { title : null } )
141
+ updateFrontmatterPatch ( slide3 . source , { title : null } )
142
142
expectFrontmatter ( slide3 ) . toMatchInlineSnapshot ( `
143
143
"dragPos:
144
144
bar: 5,6,7,8
You can’t perform that action at this time.
0 commit comments