@@ -37,6 +37,7 @@ import { linkPlugin } from './plugins/link'
37
37
import { preWrapperPlugin } from './plugins/preWrapper'
38
38
import { restoreEntities } from './plugins/restoreEntities'
39
39
import { snippetPlugin } from './plugins/snippet'
40
+ import { codeModalPlugin } from './plugins/codeModal'
40
41
41
42
export type { Header } from '../shared'
42
43
@@ -116,6 +117,16 @@ export interface MarkdownOptions extends Options {
116
117
* @default 'Copy Code'
117
118
*/
118
119
codeCopyButtonTitle ?: string
120
+ /**
121
+ * Show an additional button to open a fullscreen modal in code blocks
122
+ * @default false
123
+ */
124
+ codeModal ?: boolean
125
+ /**
126
+ * The tooltip text for the modal button in code blocks
127
+ * @default 'Open Modal'
128
+ */
129
+ codeModalButtonTitle ?: string
119
130
120
131
/* ==================== Markdown It Plugins ==================== */
121
132
@@ -201,6 +212,7 @@ export const createMarkdownRenderer = async (
201
212
) : Promise < MarkdownRenderer > => {
202
213
const theme = options . theme ?? { light : 'github-light' , dark : 'github-dark' }
203
214
const codeCopyButtonTitle = options . codeCopyButtonTitle || 'Copy Code'
215
+ const codeModalButtonTitle = options . codeModalButtonTitle || 'Open Modal'
204
216
const hasSingleTheme = typeof theme === 'string' || 'name' in theme
205
217
206
218
const md = MarkdownIt ( {
@@ -230,6 +242,7 @@ export const createMarkdownRenderer = async (
230
242
base
231
243
)
232
244
. use ( lineNumberPlugin , options . lineNumbers )
245
+ . use ( codeModalPlugin , options . codeModal , { codeModalButtonTitle } )
233
246
234
247
if ( options . gfmAlerts !== false ) {
235
248
md . use ( gitHubAlertsPlugin )
0 commit comments