Use vue to call the cnode community background interface. When editing an article, the data returned from the interface is in html format. How to convert it into markdown text (no rendering)

the front end uses vue, to receive data and textarea, to receive data. The effect is as follows

but when submitting changes, you need markdown text instead of rendering.

tried using the vue-markdown plug-in, which can render html but cannot be converted to markdown text

related codes

<textarea v-model.trim="publishData.topicContent" placeholder=""" "></textarea>
<!-- <vue-markdown :source="publishData.topicContent"></vue-markdown> -->

vue-markdown renders the converted html directly. How can I get the markdown text? It is hoped that the text can be passed into textarea for users to edit, instead of a pile of html

Jul.29,2021

there is a field in the parameters of the API for pulling articles: mdrender, can choose whether to pull content: html or markdown,. Do not read the api document carefully

Menu