striptease/textstrip

Consts

textExts = [".txt", ".text", ".md", ".markdown", ".json", ".csv", ".html",
            ".htm", ".xml", ".yaml", ".yml"]

Procs

proc checkTextInput(data: string; path: string; forceText: bool): void {.
    ...raises: [StripError], tags: [], forbids: [].}
proc cleanTextRunes(runes: seq[Rune]; opts: StripOptions): tuple[output: string,
    removed: CountTable[string], replaced: CountTable[string]] {....raises: [],
    tags: [], forbids: [].}
proc inspectTextData(data: string; aggressive = false; stripEmojiGlue = false): JsonNode {.
    ...raises: [StripError, KeyError], tags: [], forbids: [].}
Reports suspicious carriers without writing. Uses normalizeSpaces=true to match reference inspect behaviour.
func isTextPath(path: string): bool {....raises: [], tags: [], forbids: [].}
func looksLikeBinary(data: string): bool {....raises: [], tags: [], forbids: [].}
proc scrubMediaString(s: string): string {....raises: [], tags: [], forbids: [].}
Context-aware scrub for short media metadata strings shown in
--inspect JSON. Safe defaults: keep spaces and RTL marks, drop

dangerous carriers, preserve emoji glue.

proc stripTextData(data: string; opts: StripOptions): tuple[output: string,
    res: StripResult] {....raises: [StripError], tags: [], forbids: [].}
Cleans text with safe-preserve defaults. Raises StripError on binary / invalid UTF-8 unless opts.forceText.