plone.restapi currently does not support Markdown format. Plone might have a portal_transform to transform HTML to Markdown (not sure, you would need to check) and then you could write a custom endpoint (or enhance an existing endpoint) to return Markdown instead of JSON.
I would suggest starting simple and writing a custom endpoint specific to your needs. In the long run, we might include this feature in plone.restapi core. Though, this is not on the short/mid-term roadmap so far.
Is your content in Plone markdown or do you want to convert html to markdown?
PS: If you convert html to markdown and back to html, it will not look the same. Especially tables are problematic in markdown, so often I need to 'keep them in html'. Note: Markdown supports html, so markdown can contain html
Thank you. I'd like to store content that can be converted by the consumer. Plone has attractive data modeling capabilities that are more important to me than its internal rendering features.
My content can be plain text. I tried that with the "text" field (plain text is fine) but that is also converted to HTML (inserting <p> tags).
Is it possible to store text in Plone as text/plain while displaying line breaks? I could store Markdown content as text/plain and default plaintext rendering would be sufficient. I want to avoid HTML in my content and still render it in a human-readable format.
Plone mostly stores text as it is input. Exception: for security reasons, HTML structures deemed dangerous are by default filtered out -- this can be customized.
Views determine how the objects are presented -- e.g. whether text is treated as HTML or plain text. You can override existing views or define your own views.
Many things can be achieved with CSS, too. You can e.g. use CSS to keep newlines in a block.
A bit off topic, but my add-on GitHub - espenmn/medialog.markdown: Markdown widget for Plone 5 saves 'both html and markdown' (it converts markdown to html and saves it in another field). (a did this because I could not get the default plone conversion to do all I wanted).
I have not touched the code in a while, but I use the markdown editor 'all the time',
If the response tells us content-type": "text/x-web-markdown and the data is HTML this is a bug. Please file an issue at Issues · plone/plone.restapi · GitHub