Thank you very much for that pearl!
I am currently trying to understand your code, and have two questions for now:
1.
In the line
else if content.has("body") {string(string(content.body))}
why is there a recursive call to string()? Technically, the result should be exactly the same as if there was
else if content.has("body") {string(content.body)}
I suspect that I am missing something important here. Could you please shortly explain?
2.
There is the line
else if content.func() == ref {"_ref_"}
Obviously, the condition checks if the content is a reference, and if yes, returns the literal string _ref_. In the resulting file, this would lead to the string ref in italics. That is, the reference would be replaced by the string ref in italics.
Again, I am obviously missing something. Could you please shortly explain?