import * as vscode from 'vscode' ; declare function require ( path ) ; const enabledSetting = 'markdown.math.enabled' ; export function activate ( context ) { function isEnabled ( ) { const config = vscode . workspace . getConfiguration ( 'markdown' ) ; return config . get < boolean > ( 'math.enabled' , true ) ; } vscode . workspace . onDidChangeConfiguration ( e => { if ( e . affectsConfiguration ( enabledSetting ) ) { vscode . commands . executeCommand ( 'markdown.api.reloadPlugins' ) ; } } , undefined , context . subscriptions ) ; return { extendMarkdownIt ( md ) { if ( isEnabled ( ) ) { const katex = require ( '@iktakahiro/markdown-it-katex' ) ; return md . use ( katex , { globalGroup : true } ) ; } return md ; } } ; }