Inconsistent API response in /api/recent and /api/v3/posts/[pid]
-
When calling these two API endpoint, I got a different response for
content
field.This is the response from
https://community.nodebb.org/api/v3/posts/92425
This one is from
https://community.nodebb.org/api/recent
One has html tags in the content text, while the other doesn't.
My question is, how could I make the json responsecontent
field always show the html tags?Thanks in advance.
-
Hi @nullpointer — one reply is parsed by plugins, the other is the "raw" content.
/api/v3/posts/:pid
reflects what is saved in the database, so the post content is not parsed.You'll want to call
/api/v3/posts/:pid/summary
instead. Keep in mind that that route is not available yet, but is slated to be added after v3 is released. -
refactor: started work on porting posting and topic-related socket methods to write API by julianlam · Pull Request #11475 · NodeBB/NodeBB
The following socket calls have been deprecated: posts.getRawPost posts.getPostSummaryByIndex posts.getPostSummaryByPid posts.getPidIndex topics.markAsRead topics.markUnread topics.markAsUnreadFor...
GitHub (github.com)
-