@@ -9,12 +9,34 @@ import {
9
9
type Options
10
10
} from './preWrapper'
11
11
12
- export const containerPlugin = ( md : MarkdownIt , options : Options ) => {
13
- md . use ( ...createContainer ( 'tip' , 'TIP' , md ) )
14
- . use ( ...createContainer ( 'info' , 'INFO' , md ) )
15
- . use ( ...createContainer ( 'warning' , 'WARNING' , md ) )
16
- . use ( ...createContainer ( 'danger' , 'DANGER' , md ) )
17
- . use ( ...createContainer ( 'details' , 'Details' , md ) )
12
+ export const containerPlugin = (
13
+ md : MarkdownIt ,
14
+ options : Options ,
15
+ containerOptions ?: ContainerOptions
16
+ ) => {
17
+ md . use ( ...createContainer ( 'tip' , containerOptions ?. tipLabel || 'TIP' , md ) )
18
+ . use ( ...createContainer ( 'info' , containerOptions ?. infoLabel || 'INFO' , md ) )
19
+ . use (
20
+ ...createContainer (
21
+ 'warning' ,
22
+ containerOptions ?. warningLabel || 'WARNING' ,
23
+ md
24
+ )
25
+ )
26
+ . use (
27
+ ...createContainer (
28
+ 'danger' ,
29
+ containerOptions ?. dangerLabel || 'DANGER' ,
30
+ md
31
+ )
32
+ )
33
+ . use (
34
+ ...createContainer (
35
+ 'details' ,
36
+ containerOptions ?. detailsLabel || 'Details' ,
37
+ md
38
+ )
39
+ )
18
40
// explicitly escape Vue syntax
19
41
. use ( container , 'v-pre' , {
20
42
render : ( tokens : Token [ ] , idx : number ) =>
@@ -104,3 +126,11 @@ function createCodeGroup(options: Options): ContainerArgs {
104
126
}
105
127
]
106
128
}
129
+
130
+ export interface ContainerOptions {
131
+ infoLabel ?: string
132
+ tipLabel ?: string
133
+ warningLabel ?: string
134
+ dangerLabel ?: string
135
+ detailsLabel ?: string
136
+ }
0 commit comments