main
1/// - content (content):
2/// -> str
3#let to-string(content) = {
4 if (int, float, str, bytes, label, decimal, version, type).contains(
5 type(content),
6 ) {
7 str(content)
8 } else if content.has("text") and type(content.text) == str {
9 content.text
10 } else if content.has("children") {
11 content.children.map(to-string).join("")
12 } else if content.has("body") {
13 to-string(content.body)
14 } else if content == [ ] {
15 " "
16 }
17}