processImage

Helper function to process an Image node, passing information to a callback to generate the final output.

Users can override the img handler like so:

kobweb {
markdown {
handlers {
img.set {
processImage(it) { data ->
"com.myproject.components.widgets.ImageWidget(\"${data.destination}\", \"${data.altText}\")"
}
}
}
}
}

Users can of course process the Image node directly, but they should know that it carries its alt text as children nodes, which this logic abstracts away.