That is exactly the problem. As the cooked posts contain the oneboxes (which don’t have the original media links anymore, only raw has the original links) we can’t transform them into a FB IA valid format.
Iframely is producing IA valid IFRAMEs from the standalone links. We tried to use the raw posts and use a PHP markdown parser (Markdown-It for PHP) plus Iframely for the standalone links, but the Discourse markdown parsing does a lot more, and we don’t want to replicate all the magic Discourse does to the markdown. Thus, we are looking for a route to get cooked posts, but without parsed oneboxes (as we want to post-process those via Iframely instead).
Our current approach works for simple posts ie. take raw as a basis, use PHP Mardown-It to transform into HTML, and use Iframely to produce IA valid media cards (oneboxes aren’t), then transform the HTML into Facebook IA HTML and transmit via the FB PHP SDK, but as Discourse applies a lot of additional rules to the markdown parsing, it would be great to somehow get the parsed HTML directly from Discourse, but just without the oneboxes.