I like the Bar Chart and Pie Chart ☺
Is there a way to get the markdown content rather than HTML content in posts via API?
-
I noticed that through API, the content is already parsed as HTML. Is there a way to get the orignal markdown one that user typed? Because I want to integrate the system into my app and want to parse the markdown by myself. Or do I have to parse it back to markdown manually?
Thank you so much.
Edit: I found this line: https://github.com/julianlam/nodebb-plugin-markdown/blob/9d5c444dc345429e4efcf8bd0087bb9e1ec8397c/index.js#L31
we can use
/api/post/:pid/raw
to retrieve a single post's raw markdown. But it there a similar api to let us get all posts' markdown in a single topic (e.g./api/topic/:tid/raw
)? -
Anyone please?
-
If you are going to integrate into your own app, you can look into disabling the markdown plugin. This way all posts will return the raw content. You will have to parse/sanitize on your end though.
-
@baris Thanks. However, I hope my users can view the website version as well. Hope there is an API to do this in an intuitive way.
-
I don't think so, unfortunately -- you'll have to make the initial call to get the topic, and then subsequent calls to grab the raw markdown. I don't think we'll be adding a way to retrieve the raw markdown at the topic level because we wouldn't have any use for it.