From f12ba1e275b2e58d6489d32d79e6836a3f349f53 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Mon, 21 Oct 2024 23:57:43 -0600 Subject: remove unnecessary comments --- iTexSnip/Utils/KatexUtils.swift | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'iTexSnip/Utils/KatexUtils.swift') diff --git a/iTexSnip/Utils/KatexUtils.swift b/iTexSnip/Utils/KatexUtils.swift index 697e700..5daaf13 100644 --- a/iTexSnip/Utils/KatexUtils.swift +++ b/iTexSnip/Utils/KatexUtils.swift @@ -14,17 +14,15 @@ func change( var result = "" var i = 0 let n = inputStr.count - let inputArray = Array(inputStr) // Convert string to array of characters for easier access + let inputArray = Array(inputStr) while i < n { - // Get the range for the substring equivalent to oldInst if i + oldInst.count <= n && inputStr[ inputStr.index( inputStr.startIndex, offsetBy: i).. String { var res = formula - // Remove mbox surrounding res = changeAll( inputStr: res, oldInst: "\\mbox ", newInst: " ", oldSurrL: "{", oldSurrR: "}", newSurrL: "", newSurrR: "") @@ -135,16 +132,13 @@ func toKatex(formula: String) -> String { inputStr: res, oldInst: "\\mbox", newInst: " ", oldSurrL: "{", oldSurrR: "}", newSurrL: "", newSurrR: "") - // Additional processing similar to the Python version... res = res.replacingOccurrences(of: "\\[", with: "") res = res.replacingOccurrences(of: "\\]", with: "") res = res.replacingOccurrences( of: "\\\\[?.!,\'\"](?:\\s|$)", with: "", options: .regularExpression) - // Merge consecutive `text` res = rmDollarSurr(content: res) - // Remove extra spaces res = res.replacingOccurrences(of: " +", with: " ", options: .regularExpression) return res.trimmingCharacters(in: .whitespacesAndNewlines) -- cgit v1.2.3