# Working with different needs in raw/cooked content

**URL:** https://meta.discourse.org/t/working-with-different-needs-in-raw-cooked-content/46723
**Category:** Development
**Created:** [7월 1, 2016, 7:36오후 UTC](https://meta.discourse.org/t/working-with-different-needs-in-raw-cooked-content/46723 "2016-07-01T19:36:07Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![cappslock](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cappslock/32/120789_2.png) [@cappslock](https://meta.discourse.org/u/cappslock)
#### Post date: [7월 1, 2016, 7:36오후 UTC](https://meta.discourse.org/t/working-with-different-needs-in-raw-cooked-content/46723/1 "2016-07-01T19:36:07Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [7월 1, 2016, 10:59오후 UTC](https://meta.discourse.org/t/working-with-different-needs-in-raw-cooked-content/46723/2 "2016-07-01T22:59:38Z")

</div>

What are the exact changes to md you are after?

---

<div class="post-metadata">

### Author: ![cappslock](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cappslock/32/120789_2.png) [@cappslock](https://meta.discourse.org/u/cappslock)
#### Post date: [7월 2, 2016, 8:24오후 UTC](https://meta.discourse.org/t/working-with-different-needs-in-raw-cooked-content/46723/3 "2016-07-02T20:24:35Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [7월 2, 2016, 8:54오후 UTC](https://meta.discourse.org/t/working-with-different-needs-in-raw-cooked-content/46723/4 "2016-07-02T20:54:15Z")

</div>

Something like this?

\* open in new tab  
[https://meta.discourse.org/raw/46723](https://meta.discourse.org/raw/46723)

---

<div class="post-metadata">

### Author: ![cappslock](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cappslock/32/120789_2.png) [@cappslock](https://meta.discourse.org/u/cappslock)
#### Post date: [7월 2, 2016, 9:16오후 UTC](https://meta.discourse.org/t/working-with-different-needs-in-raw-cooked-content/46723/5 "2016-07-02T21:16:13Z")

</div>

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: [Discourse REST API Documentation](https://meta.discourse.org/t/discourse-api-documentation/22706)

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [7월 2, 2016, 10:02오후 UTC](https://meta.discourse.org/t/working-with-different-needs-in-raw-cooked-content/46723/6 "2016-07-02T22:02:51Z")

</div>

> [@cappslock](#):
>
> how do you know about that route?

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.

> [@cappslock](#):
>
> Is there some better API documentation than this topic

Well, I don’t if it’s better. That’s subjective. But there’s this.  
[https://github.com/discourse/discourse\_api](https://github.com/discourse/discourse_api)

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [7월 7, 2016, 9:57오전 UTC](https://meta.discourse.org/t/working-with-different-needs-in-raw-cooked-content/46723/7 "2016-07-07T09:57:02Z")

</div>

> [@cappslock](#):
>
> Increasingly I think just getting access to the raw content of the original post (3) is probably what I want.

This request has come up a couple of times now. @marktheis & co also wants this:

> [@Using Discourse as a community-powered wiki](https://meta.discourse.org/t/using-discourse-as-a-community-powered-wiki/43599):
>
> The following is a guest post by Sam Nazarko, CEO and founder of [OSMC.tv](http://OSMC.tv) Are you using Discourse in a novel way? If you’re interested in writing a guest post like this one, please get in touch. In 2014, I started working on a new project, OSMC (Open Source Media Center). OSMC is a free and… This topic is for comments on the original blog entry at: [Using Discourse as a community-powered wiki](http://blog.discourse.org/2016/05/using-discourse-as-a-community-powered-wiki/)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [5월 15, 2025, 12:20오전 UTC](https://meta.discourse.org/t/working-with-different-needs-in-raw-cooked-content/46723/8 "2025-05-15T00:20:01Z")

</div>

> [@cappslock](#):
>
> 네, 하지만 모든 게시물에 대해 그렇게 하면 비용이 많이 들게 됩니다. 이상적으로는 토픽 API(`t/:topicId.json`)에서 이 기능을 제거하는 방법이 필요합니다.

현재는 `?include_raw=true`를 추가함으로써 이미 구현되어 있습니다.

예:

```plaintext
https://meta.discourse.org/t/working-with-different-needs-in-raw-cooked-content/46723.json?include_raw=true

```
