@@ -111,6 +111,11 @@ export interface MarkdownOptions extends Options {
111111 * Setup Shiki instance
112112 */
113113 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
114119
115120 /* ==================== Markdown It Plugins ==================== */
116121
@@ -195,6 +200,7 @@ export const createMarkdownRenderer = async (
195200 logger : Pick < Logger , 'warn' > = console
196201) : Promise < MarkdownRenderer > => {
197202 const theme = options . theme ?? { light : 'github-light' , dark : 'github-dark' }
203+ const codeCopyButtonTitle = options . codeCopyButtonTitle || 'Copy Code'
198204 const hasSingleTheme = typeof theme === 'string' || 'name' in theme
199205
200206 const md = MarkdownIt ( {
@@ -214,7 +220,7 @@ export const createMarkdownRenderer = async (
214220 // custom plugins
215221 md . use ( componentPlugin , { ...options . component } )
216222 . use ( highlightLinePlugin )
217- . use ( preWrapperPlugin , { hasSingleTheme } )
223+ . use ( preWrapperPlugin , { codeCopyButtonTitle , hasSingleTheme } )
218224 . use ( snippetPlugin , srcDir )
219225 . use ( containerPlugin , { hasSingleTheme } , options . container )
220226 . use ( imagePlugin , options . image )
@@ -229,7 +235,7 @@ export const createMarkdownRenderer = async (
229235 md . use ( gitHubAlertsPlugin )
230236 }
231237
232- // 3rd party plugins
238+ // third party plugins
233239 if ( ! options . attrs ?. disable ) {
234240 md . use ( attrsPlugin , options . attrs )
235241 }
0 commit comments