# Markdown, BBCode, and Emoji Not Rendering In API Post

**URL:** <https://meta.discourse.org/t/markdown-bbcode-and-emoji-not-rendering-in-api-post/279636>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [September 21, 2023, 1:18am UTC](https://meta.discourse.org/t/markdown-bbcode-and-emoji-not-rendering-in-api-post/279636 "2023-09-21T01:18:33Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [September 23, 2023, 10:19pm UTC](https://meta.discourse.org/t/markdown-bbcode-and-emoji-not-rendering-in-api-post/279636/5 "2023-09-23T22:19:29Z")

</div>

> [@BeefofAges](#):
>
> only accepted HTML tags are parsed. Markdown, BBCode, and emojis are not rendered correctly.

### Emojis and HTML

I think the issue you are running into with emoji shortcodes that are wrapped in HTML tags is the expected behavior. It can be reproduced in a post that’s created within the Discourse post editor. For example `:face_with_symbols_over_mouth:` will render as 🤬 within this paragraph.

If I use `p` tags to create a paragraph instead if relying on the markdown engine to do it, the shortcode won’t be rendered. For example:

```plaintext
<p>This sentence contains an emoji shortcode :face_with_symbols_over_mouth:</p>

```

This sentence contains an emoji shortcode :face\_with\_symbols\_over\_mouth:

### Markdown

The issue with posting markdown via the API seems solvable, but maybe tricky to work with. Using curl from the terminal, something like this should work:

```plaintext
m="### this is a heading
                                                                                                                                                           
This is a very short paragraph with some _emphasis_ on a word.

This is another paragraph with a :slight_smile: emoji

- this
- is
- an
- unordered
- list

Followed by another paragraph.

1) and
2) an
3) ordered
4) list"

```

`curl -X POST "http://localhost:4200/posts.json" -H "Api-Key: $api_key" -H "Api-Username: simon" -F "title=Markdown test one" -F "category=6" -F "skip_validations=true" -F "raw=$m" `

The `skip_validations` parameter in the above request is just there to prevent “body too short” or “duplicate title” types of errors when testing. It bypasses a bunch of site settings (min post length, body min entropy, min topic title length, etc.)

I’m unsure about the BBCode issue. Do the BBCode tags that you are trying to render work when added to your Discourse site’s post editor?

---

_[View the full topic](https://meta.discourse.org/t/markdown-bbcode-and-emoji-not-rendering-in-api-post/279636)._
