How to use the @shd101wyy/mume.utility.addFileProtocol function in @shd101wyy/mume

To help you get started, we’ve selected a few @shd101wyy/mume examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shd101wyy / vscode-markdown-preview-enhanced / src / extension.ts View on Github external
function clickTagA(uri, href) {
    href = decodeURIComponent(href);
    href = href.replace(/^vscode\-resource:\/\/\//, "file:///");
    if (
      [".pdf", ".xls", ".xlsx", ".doc", ".ppt", ".docx", ".pptx"].indexOf(
        path.extname(href),
      ) >= 0
    ) {
      utility.openFile(href);
    } else if (href.match(/^file\:\/\/\//)) {
      // openFilePath = href.slice(8) # remove protocol
      let openFilePath = utility.addFileProtocol(
        href.replace(/(\s*)[\#\?](.+)$/, ""),
      ); // remove #anchor and ?params...
      openFilePath = decodeURI(openFilePath);
      vscode.commands.executeCommand(
        "vscode.open",
        vscode.Uri.parse(openFilePath),
        vscode.ViewColumn.One,
      );
    } else {
      utility.openFile(href);
    }
  }
github shd101wyy / vscode-markdown-preview-enhanced / src / extension.ts View on Github external
function openMathJaxConfig() {
    const mathjaxConfigFilePath = utility.addFileProtocol(
      path.resolve(utility.extensionConfigDirectoryPath, "./mathjax_config.js"),
    );
    vscode.commands.executeCommand(
      "vscode.open",
      vscode.Uri.parse(mathjaxConfigFilePath),
    );
  }
github shd101wyy / vscode-markdown-preview-enhanced / src / extension.ts View on Github external
function openKaTeXConfig() {
    const katexConfigFilePath = utility.addFileProtocol(
      path.resolve(utility.extensionConfigDirectoryPath, "./katex_config.js"),
    );
    vscode.commands.executeCommand(
      "vscode.open",
      vscode.Uri.parse(katexConfigFilePath),
    );
  }
github shd101wyy / vscode-markdown-preview-enhanced / src / extension.ts View on Github external
function extendParser() {
    const parserConfigPath = utility.addFileProtocol(
      path.resolve(utility.extensionConfigDirectoryPath, "./parser.js"),
    );
    vscode.commands.executeCommand(
      "vscode.open",
      vscode.Uri.parse(parserConfigPath),
    );
  }
github shd101wyy / vscode-markdown-preview-enhanced / src / extension.ts View on Github external
function openMermaidConfig() {
    const mermaidConfigFilePath = utility.addFileProtocol(
      path.resolve(utility.extensionConfigDirectoryPath, "./mermaid_config.js"),
    );
    vscode.commands.executeCommand(
      "vscode.open",
      vscode.Uri.parse(mermaidConfigFilePath),
    );
  }
github shd101wyy / vscode-markdown-preview-enhanced / src / extension.ts View on Github external
function customizeCSS() {
    const globalStyleLessFile = utility.addFileProtocol(
      path.resolve(utility.extensionConfigDirectoryPath, "./style.less"),
    );
    vscode.commands.executeCommand(
      "vscode.open",
      vscode.Uri.parse(globalStyleLessFile),
    );
  }
github shd101wyy / vscode-markdown-preview-enhanced / src / extension.ts View on Github external
function showUploadedImages() {
    const imageHistoryFilePath = utility.addFileProtocol(
      path.resolve(utility.extensionConfigDirectoryPath, "./image_history.md"),
    );
    vscode.commands.executeCommand(
      "vscode.open",
      vscode.Uri.parse(imageHistoryFilePath),
    );
  }