Files
Rocky 9f308fadd2 feat(keyboard): ship AI hint carousel, home library cards, and clipboard polish
Rotate AI idle suggestions with optional remote packs, move history/dictionary onto self-sizing Home preview cards, harden clipboard capture/prompting, and simplify keyboard chrome by dropping most liquid-glass shadows.
2026-08-13 01:00:51 +08:00

18 lines
540 B
Swift

// 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: "&lt;")
.replacingOccurrences(of: ">", with: "&gt;")
.replacingOccurrences(of: "\"", with: "&quot;")
.replacingOccurrences(of: "'", with: "&apos;")
}
}