mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-23 14:05:33 +00:00
Parsing speedup
This commit is contained in:
parent
b3e1add178
commit
58c928f12d
@ -359,7 +359,7 @@ public struct TranslateRule: Codable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func getTranslateUrl(_ message: String,_ toLang: String) -> String {
|
public func getTranslateUrl(_ message: String,_ toLang: String) -> String {
|
||||||
let sanitizedMessage = message.replaceCharactersFromSet(characterSet:CharacterSet.newlines, replacementString: "<br>")
|
let sanitizedMessage = message // message.replaceCharactersFromSet(characterSet:CharacterSet.newlines, replacementString: "<br>")
|
||||||
|
|
||||||
var queryCharSet = NSCharacterSet.urlQueryAllowed
|
var queryCharSet = NSCharacterSet.urlQueryAllowed
|
||||||
queryCharSet.remove(charactersIn: "+&")
|
queryCharSet.remove(charactersIn: "+&")
|
||||||
@ -367,7 +367,8 @@ public func getTranslateUrl(_ message: String,_ toLang: String) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func prepareResultString(_ str: String) -> String {
|
func prepareResultString(_ str: String) -> String {
|
||||||
return str.htmlDecoded.replacingOccurrences(of: "<br>", with: "\n").replacingOccurrences(of: "< br>", with: "\n").replacingOccurrences(of: "<br >", with: "\n")
|
return str
|
||||||
|
// return str.htmlDecoded.replacingOccurrences(of: "<br>", with: "\n").replacingOccurrences(of: "< br>", with: "\n").replacingOccurrences(of: "<br >", with: "\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
var regexCache: [String: NSRegularExpression] = [:]
|
var regexCache: [String: NSRegularExpression] = [:]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user