justinwongcn/moon-ical/ical/text does not have a README file
impl Show for ParseErrorpub struct ContentLine {
name : String
params : Array[PropertyParam]
value : String
} derive(Eq, Debug)fn escape_value(text : String) -> Stringfn test_example() {
assert_eq(
@text.escape_value("Team sync, 2026\nRoom B"),
"Team sync\\, 2026\\nRoom B",
)
}fn test_example() raise {
let line = @text.parse_content_line(
"DTSTART;TZID=Asia/Shanghai:20260908T093000", 1,
)
assert_eq(line.name, "DTSTART")
assert_eq(line.params[0].value, "Asia/Shanghai")
assert_eq(line.value, "20260908T093000")
}fn unescape_value(value : String) -> Stringfn test_example() {
assert_eq(
@text.unescape_value("Team sync\\, 2026\\nRoom B"),
"Team sync, 2026\nRoom B",
)
}fn test_example() {
let lines = @text.unfold("DESCRIPTION:Line one\r\n more\r\nSUMMARY:Two")
// The single leading WSP is consumed by unfolding, so "more" joins
// directly onto "Line one".
assert_eq(lines, ["DESCRIPTION:Line onemore", "SUMMARY:Two"])
}Install
Download zipiCalendar (RFC 5545) parsing, recurrence expansion, and a minimal CalDAV server in pure MoonBit
Dependencies