@@ -111,6 +111,11 @@ export interface MarkdownOptions extends Options {
111
111
* Setup Shiki instance
112
112
*/
113
113
shikiSetup ?: ( shiki : Highlighter ) => void | Promise < void >
114
+ /**
115
+ * The tooltip text for the copy button in code blocks
116
+ * @default 'Copy Code'
117
+ */
118
+ codeCopyButtonTitle ?: string
114
119
115
120
/* ==================== Markdown It Plugins ==================== */
116
121
@@ -195,6 +200,7 @@ export const createMarkdownRenderer = async (
195
200
logger : Pick < Logger , 'warn' > = console
196
201
) : Promise < MarkdownRenderer > => {
197
202
const theme = options . theme ?? { light : 'github-light' , dark : 'github-dark' }
203
+ const codeCopyButtonTitle = options . codeCopyButtonTitle || 'Copy Code'
198
204
const hasSingleTheme = typeof theme === 'string' || 'name' in theme
199
205
200
206
const md = MarkdownIt ( {
@@ -214,7 +220,7 @@ export const createMarkdownRenderer = async (
214
220
// custom plugins
215
221
md . use ( componentPlugin , { ...options . component } )
216
222
. use ( highlightLinePlugin )
217
- . use ( preWrapperPlugin , { hasSingleTheme } )
223
+ . use ( preWrapperPlugin , { codeCopyButtonTitle , hasSingleTheme } )
218
224
. use ( snippetPlugin , srcDir )
219
225
. use ( containerPlugin , { hasSingleTheme } , options . container )
220
226
. use ( imagePlugin , options . image )
@@ -229,7 +235,7 @@ export const createMarkdownRenderer = async (
229
235
md . use ( gitHubAlertsPlugin )
230
236
}
231
237
232
- // 3rd party plugins
238
+ // third party plugins
233
239
if ( ! options . attrs ?. disable ) {
234
240
md . use ( attrsPlugin , options . attrs )
235
241
}
0 commit comments