API for preview

I was playing around with a native client for Discourse using the JSON API.

Most things like posting, loading posts, etc. seems to be possible. One thing I’m struggling with matching from the web is the preview. I could of course try to process the Markdown the user entered with one of the many Markdown libs out there to get HTML, but I’d like to make sure the preview is using the same logic Discourse is using.

Is there an endpoint to get something like an HTML preview (ideally with CSS) upon submitting raw text the user wrote but without actually posting it?