# Strangely ordered markdown + HTML is shown differently in post vs. preview

**URL:** https://meta.discourse.org/t/strangely-ordered-markdown-html-is-shown-differently-in-post-vs-preview/124468
**Category:** Support
**Created:** [30 juli 2019 om 23:24 UTC](https://meta.discourse.org/t/strangely-ordered-markdown-html-is-shown-differently-in-post-vs-preview/124468 "2019-07-30T23:24:27Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [30 juli 2019 om 23:24 UTC](https://meta.discourse.org/t/strangely-ordered-markdown-html-is-shown-differently-in-post-vs-preview/124468/1 "2019-07-30T23:24:27Z")

</div>

```plaintext
**<big>This is a test:** End test.</big>

```

Preview shows (image):  
 ![image](https://global.discourse-cdn.com/meta/original/3X/c/0/c06f94e28d2463137708d0f9256a5e4560d9b38e.png)

Actually shows (image for historical reference):  
 ![image](https://global.discourse-cdn.com/meta/original/3X/5/1/51bfc46b11f7edfb88687f5fd42a4e48ba68f1bd.png)

Actually shows (text):  
**This is a test:** End test.

* * *

Changing it to

```plaintext
<big> **This is a test:** End test.</big>

```

as I’d meant to do shows it correctly and consistently. I’m not sure what the expected behavior of the strangely ordered markdown + HTML should be, but it should at least be consistent between the preview and the actual post.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [31 juli 2019 om 04:55 UTC](https://meta.discourse.org/t/strangely-ordered-markdown-html-is-shown-differently-in-post-vs-preview/124468/2 "2019-07-31T04:55:34Z")

</div>

Inconsistent ordering of tags is not supported in any markup engine, and will always produce unknown and generally bad results.

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [31 juli 2019 om 09:13 UTC](https://meta.discourse.org/t/strangely-ordered-markdown-html-is-shown-differently-in-post-vs-preview/124468/3 "2019-07-31T09:13:37Z")

</div>

Okay. So I’m curious then, what does the preview and post rendering do differently that can cause inconsistencies?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [31 juli 2019 om 09:53 UTC](https://meta.discourse.org/t/strangely-ordered-markdown-html-is-shown-differently-in-post-vs-preview/124468/4 "2019-07-31T09:53:30Z")

</div>

This is well documented all over the internet, for example [http://www.bu.edu/tech/services/cccs/websites/www/non-wordpress/start/html-introduction/syntax/nesting-tags/](http://www.bu.edu/tech/services/cccs/websites/www/non-wordpress/start/html-introduction/syntax/nesting-tags/)

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [31 juli 2019 om 10:24 UTC](https://meta.discourse.org/t/strangely-ordered-markdown-html-is-shown-differently-in-post-vs-preview/124468/5 "2019-07-31T10:24:46Z")

</div>

I was referring specifically to Discourse’s rendering engine. I get that it’s not supported to use misordered tags. I was just curious if, for example, there are two separate implementations, whether the algorithm is nondeterministic, etc.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [31 juli 2019 om 19:36 UTC](https://meta.discourse.org/t/strangely-ordered-markdown-html-is-shown-differently-in-post-vs-preview/124468/6 "2019-07-31T19:36:14Z")

</div>

There are differences in markup between the preview and topics. Most of them are related to some content being added on the server side (like one boxes), but others are as simple as where it is in the DOM. The composer has a different HTML structure than the posts view, and that’s enough to make a difference in unsupported behaviour like this.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2 februari 2023 om 07:12 UTC](https://meta.discourse.org/t/strangely-ordered-markdown-html-is-shown-differently-in-post-vs-preview/124468/7 "2023-02-02T07:12:46Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2 februari 2023 om 07:41 UTC](https://meta.discourse.org/t/strangely-ordered-markdown-html-is-shown-differently-in-post-vs-preview/124468/8 "2023-02-02T07:41:29Z")

</div>


