// PromptXMLEscaping.swift // OSGKeyboard ยท Shared // // Escapes untrusted prompt data embedded in XML-like text nodes. import Foundation enum PromptXMLEscaping { static func escapeTextContent(_ text: String) -> String { text .replacingOccurrences(of: "&", with: "&") .replacingOccurrences(of: "<", with: "<") .replacingOccurrences(of: ">", with: ">") .replacingOccurrences(of: "\"", with: """) .replacingOccurrences(of: "'", with: "'") } }