cappslock | 2016-08-08 23:03:48 UTC | #1 I'm using only the API of Discourse with a custom UI. I want to support some custom Markdown extensions which I'd like the "cooked" content of a post to honor. I think there are probably a few ways to do this: 1. Get Discourse to use a custom Markdown parser 2. When posting, convert the Markdown to HTML before submitting it to the Discourse API 3. Getting access to the "raw" post in addition to the "cooked" post after it's been submitted 1 won't work for me if it requires a code change to Discourse, because I'd like to use the hosted version. 2 is fine, but we're still largely limited by what gets "cooked". For example, we may want to show some dynamic content. Increasingly I think just getting access to the raw content of the original post (3) is probably what I want. Is there a way to do this? Can "cooking" content be disabled via a setting, or the "raw" content obtained via some API call? ------------------------- sam | 2016-07-01 22:59:38 UTC | #2 What are the exact changes to md you are after? ------------------------- cappslock | 2016-07-02 20:24:35 UTC | #3 That's not totally determined yet, but it's likely that some content will be rendered dynamically which suggests we won't want the "cooked" version to be static HTML. I think what we really want is the ability to control _what_ we're cooking, since we obviously don't want to throw away whatever sanitation work is done in the process. In our case, we'd probably want to convert "raw" markdown to "cooked" markdown (with whatever scrubbing/moderation happens in that process left intact). I don't know if this is on the roadmap or what the timeline is, but failing that, it would at least be useful to be able to get access to the "raw" submission content. Is this possible? ------------------------- Mittineague | 2016-07-02 20:54:58 UTC | #4 Something like this? \* open in new tab https://meta.discourse.org/raw/46723 ------------------------- cappslock | 2016-07-02 21:17:55 UTC | #5 Yes, but doing that for every post is going to get expensive. Ideally I want a way to get this off the topic API (`t/:topicId.json`) BTW, how do you know about that route? Is there some better API documentation than this topic: https://meta.discourse.org/t/discourse-api-documentation/22706 ------------------------- Mittineague | 2016-07-02 22:02:51 UTC | #6 [quote="cappslock, post:5, topic:46723"] how do you know about that route? [/quote] I guess mostly because I've spent a lot of time here, I've read a lot of posts and I've read a good number of lines of code. But also because when I was looking at how post revision history works (note the "raw" button) it could be seen (using the browsers dev tools) that a "raw" route was used. [quote="cappslock, post:5, topic:46723"] Is there some better API documentation than this topic [/quote] Well, I don't if it's better. That's subjective. But there's this. https://github.com/discourse/discourse_api ------------------------- erlend_sh | 2016-07-07 09:57:02 UTC | #7 [quote="cappslock, post:1, topic:46723"] Increasingly I think just getting access to the raw content of the original post (3) is probably what I want. [/quote] This request has come up a couple of times now. @marktheis & co also wants this: https://meta.discourse.org/t/using-discourse-as-a-community-powered-wiki/43599?u=erlend_sh -------------------------