File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,11 @@ const defaultTheme: Theme = {
157
157
// 'word-break': `break-all`,
158
158
} ,
159
159
160
+ em : {
161
+ 'font-style' : `italic` ,
162
+ 'font-size' : `inherit` ,
163
+ } ,
164
+
160
165
link : {
161
166
color : `#576b95` ,
162
167
} ,
@@ -297,6 +302,9 @@ const graceTheme = toMerged(defaultTheme, {
297
302
codespan : {
298
303
} ,
299
304
305
+ em : {
306
+ } ,
307
+
300
308
link : {
301
309
} ,
302
310
Original file line number Diff line number Diff line change 1
1
import type { PropertiesHyphen } from 'csstype'
2
2
3
3
type Block = `h1` | `h2` | `h3` | `h4` | `p` | `blockquote` | `blockquote_p` | `code_pre` | `code` | `image` | `ol` | `ul` | `footnotes` | `figure` | `hr`
4
- type Inline = `listitem` | `codespan` | `link` | `wx_link` | `strong` | `table` | `thead` | `td` | `footnote` | `figcaption`
4
+ type Inline = `listitem` | `codespan` | `link` | `wx_link` | `strong` | `table` | `thead` | `td` | `footnote` | `figcaption` | `em`
5
5
6
6
interface CustomCSSProperties {
7
7
[ `--md-primary-color` ] ?: string
Original file line number Diff line number Diff line change @@ -222,12 +222,12 @@ export function initRenderer(opts: IOpts) {
222
222
return styledContent ( `link` , text , `span` )
223
223
} ,
224
224
225
- strong ( { text } : Tokens . Strong ) : string {
226
- return styledContent ( `strong` , text )
225
+ strong ( { tokens } : Tokens . Strong ) : string {
226
+ return styledContent ( `strong` , this . parser . parseInline ( tokens ) )
227
227
} ,
228
228
229
- em ( { text } : Tokens . Em ) : string {
230
- return `<span style="font-style: italic;"> ${ text } </ span>`
229
+ em ( { tokens } : Tokens . Em ) : string {
230
+ return styledContent ( `em` , this . parser . parseInline ( tokens ) , ` span` )
231
231
} ,
232
232
233
233
table ( { header, rows } : Tokens . Table ) : string {
You can’t perform that action at this time.
0 commit comments