From 10a4eb409cb0b0ef09b6e74ed5b1fc5a8489d36a Mon Sep 17 00:00:00 2001 From: Nyimbi Odero Date: Mon, 2 Dec 2024 09:51:13 +0300 Subject: [PATCH] removed main.js --- main.js | 101 -------------------------------------------------------- 1 file changed, 101 deletions(-) delete mode 100644 main.js diff --git a/main.js b/main.js deleted file mode 100644 index 6553546..0000000 --- a/main.js +++ /dev/null @@ -1,101 +0,0 @@ -/* -THIS IS A GENERATED/BUNDLED FILE BY ESBUILD -if you want to view the source, please visit the github repository of this plugin -*/ - -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); -var __export = (target, all) => { - __markAsModule(target); - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __reExport = (target, module2, desc) => { - if (module2 && typeof module2 === "object" || typeof module2 === "function") { - for (let key of __getOwnPropNames(module2)) - if (!__hasOwnProp.call(target, key) && key !== "default") - __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); - } - return target; -}; -var __toModule = (module2) => { - return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); -}; -var __async = (__this, __arguments, generator) => { - return new Promise((resolve, reject) => { - var fulfilled = (value) => { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - }; - var rejected = (value) => { - try { - step(generator.throw(value)); - } catch (e) { - reject(e); - } - }; - var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); - step((generator = generator.apply(__this, __arguments)).next()); - }); -}; - -// main.ts -__export(exports, { - default: () => EquationConverterPlugin -}); -var import_obsidian = __toModule(require("obsidian")); -var EquationConverterPlugin = class extends import_obsidian.Plugin { - onload() { - return __async(this, null, function* () { - const ribbonIconEl = this.addRibbonIcon("calculator", "Convert Equations", (evt) => __async(this, null, function* () { - const activeView = this.app.workspace.getActiveViewOfType(import_obsidian.MarkdownView); - if (activeView) { - const editor = activeView.editor; - const content = editor.getValue(); - const convertedContent = this.convertEquations(content); - editor.setValue(convertedContent); - } - })); - this.addCommand({ - id: "convert-equations", - name: "Convert Equations in Current File", - editorCallback: (editor) => { - const content = editor.getValue(); - const convertedContent = this.convertEquations(content); - editor.setValue(convertedContent); - } - }); - }); - } - convertEquations(text) { - if (typeof text !== "string") { - return text; - } - text = text.replace(/\\\\\\\[/g, "ESCAPED_OPEN_BRACKET").replace(/\\\\\\\]/g, "ESCAPED_CLOSE_BRACKET").replace(/\\\\\\\(/g, "ESCAPED_OPEN_PAREN").replace(/\\\\\\\)/g, "ESCAPED_CLOSE_PAREN"); - text = text.replace(/(? { - content = content.trim(); - return ` -$$ -${content} -$$ -`; - }); - text = text.replace(/(? { - content = content.trim(); - return `$${content}$`; - }); - text = text.replace(/ESCAPED_OPEN_BRACKET/g, "\\[").replace(/ESCAPED_CLOSE_BRACKET/g, "\\]").replace(/ESCAPED_OPEN_PAREN/g, "\\(").replace(/ESCAPED_CLOSE_PAREN/g, "\\)"); - text = text.replace(/\n{3,}/g, "\n\n"); - return text; - } - onunload() { - } -};