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:
<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:
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?