Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.activate = function activate(context) {
let mdit = null; // markdown-it object ...
const kt = require('katex'),
tm = require('markdown-it-texmath').use(kt),
path = require('path'),
fs = require('fs'),
cfg = (key) => vscode.workspace.getConfiguration('mdmath')[key],
infoMsg = (msg) => {
vscode.window.showInformationMessage(`Markdown + Math: ${msg}`);
},
errMsg = (msg) => {
vscode.window.showErrorMessage(`Markdown + Math: ${msg}`);
},
asHTML = () => {
const doc = vscode.window.activeTextEditor
&& vscode.window.activeTextEditor.document,
usrcss = cfg('style');
if (!doc || doc.languageId !== 'markdown')
return infoMsg('Active document is no markdown source document!');