I want to be able to call a function by splitting some text containing a marker.
I found a way to correctly extract the text I need, split it on a marker (-- in the example), but then I have an array of content instead of just having content, and I don’t know how to convert it back to something that can be displayed normally.
#let print(lhs, rhs) = [
- Left: "#lhs"
- Right: "#rhs"
]
#show heading.where(level: 2): it => {
let (lhs, rhs) = it.body.fields().children.split([--])
print(lhs, rhs)
}
== left part -- right *part* with more words
This does print:
- ([left part], [ ])
- ([ ], [right], [ ], strong(body: [part]), [ ], [with more words])
What I want (with the word part in bold:
- left part
- right part with more words