Xml.entity: def of gralha-xml-doc@0.1.0.1 Import: import gralha-xml-doc@0.1.0.1/xml.bend as Xml Lines 333-342 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=333&end_line=342 import Base import gralha-text-scan@0.1.0.1/scan.bend as U # Decode XML entities before interpreting attributes or exposing source editing. def entity(+s: String) -> String: U.branch(String, U.string.equal(s, "amp"), _ => "&", _ => U.branch(String, U.string.equal(s, "lt"), _ => "<", _ => U.branch(String, U.string.equal(s, "gt"), _ => ">", _ => U.branch(String, U.string.equal(s, "quot"), _ => "\"", _ => U.branch(String, U.string.equal(s, "apos"), _ => "'", _ => U.branch(String, U.prefix(s, "#x"), _ => SCon{Chr{U.hex(U.drop(s, "#x"), 0)}, ""}, _ => U.branch(String, U.prefix(s, "#"), _ => SCon{Chr{F32.to_u32(U.scalar(U.drop(s, "#"), 65533.0))}, ""}, _ => "&" ++ s ++ ";"))))))) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.to_u32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=branch https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=drop https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=hex https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=prefix https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=scalar https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=string.equal