Xml.escape.rev: def of gralha-xml-doc@0.1.0.1 Import: import gralha-xml-doc@0.1.0.1/xml.bend as Xml Lines 416-425 of gralha-xml-doc@0.1.0.1/xml.bend: https://jend.leeeet.dev/read.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&start_line=416&end_line=425 import Base import gralha-text-scan@0.1.0.1/scan.bend as U # Build escaped XML in reverse, so large data URIs do not grow the host stack. def escape.rev(s: String, acc: String) -> String: match s: case SNil{}: acc case SCon{Chr{c}, t}: +ch = c escape.rev(t, U.rev(U.choose(String, U32.is_eq(ch, 38), "&", U.choose(String, U32.is_eq(ch, 60), "<", U.choose(String, U32.is_eq(ch, 62), ">", U.choose(String, U32.is_eq(ch, 34), """, SCon{Chr{ch}, ""})))), acc)) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=choose https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=rev