# Markdown preview and result differ

**URL:** <https://meta.discourse.org/t/markdown-preview-and-result-differ/263878>\
**Category:** Bug\
**Tags:** composer\
**Created:** [May 4, 2023, 8:05pm UTC](https://meta.discourse.org/t/markdown-preview-and-result-differ/263878 "2023-05-04T20:05:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)\
**Post date:** [May 4, 2023, 8:22pm UTC](https://meta.discourse.org/t/markdown-preview-and-result-differ/263878/2 "2023-05-04T20:22:38Z")

</div>

Hi @roke_julian_lockhart

I can repro it and the preview indeed differs from the post. 🙂

The empty line below or above your tags plays a little role here but it’s not important. If you remove them, it will wrap the closest next and previous content, but not the _whole_ content.

> **no empty lines**
>
> ~~Additionally, how come
> 
> ```qml
> import QtQuick
> import QtQuick.Controls 2.15 as QQC2
> import QtQuick.Layouts
> import QtPositioning
> 
> ```
> 
> ~~
> 
> and prepension of `QQC2` before `Action`, `Button`, `ApplicationWindow`, and `Frame` doesn’t work, whereas
> 
> ```qml
> import QtQuick
> import QtQuick.Controls
> import QtQuick.Layouts
> import QtPositioning
> import QtQuick.Controls 2.15 as QQC2
> 
> ```
> 
> ~~and addition of `QQC2.Button` (per [[qml+pyqt6] Can't get native control appearance - #2 by carl - Help - KDE Discuss](https://discuss.kde.org/t/qml-pyqt6-cant-get-native-control-appearance/1240/2?u=rokejulianlockhart)) does?  
> A new line  
> ~~
> 
> ![image](https://global.discourse-cdn.com/meta/original/4X/c/2/4/c24ccb34a39551a456fe377fc85c1b5ab2b37102.png)

* * *

That said…  
I thought the issue was because `<strike>`\[1\] was an inline element. I can repro it with other tags such as `<b>` or `<i>`, but not `<strong>`, `<em>`. So it’s not because it’s an inline-level element. Discourse allows wrapping blocks with inlines, from what I can see with `<strong>` or `<em>`.

> **\<strong\>**
>
> ````plaintext
> <strong>
> 
> Additionally, how come
> 
> ```qml
> import QtQuick
> import QtQuick.Controls 2.15 as QQC2
> import QtQuick.Layouts
> import QtPositioning
> ```
> 
> and prepension of `QQC2` before `Action`, `Button`, `ApplicationWindow`, and `Frame` doesn't work, whereas
> 
> ```qml
> import QtQuick
> import QtQuick.Controls
> import QtQuick.Layouts
> import QtPositioning
> import QtQuick.Controls 2.15 as QQC2
> ```
> 
> and addition of `QQC2.Button` (per https://discuss.kde.org/t/qml-pyqt6-cant-get-native-control-appearance/1240/2?u=rokejulianlockhart) does?
> A new line
> 
> </strong>
> 
> ````
> 
> ![image](https://global.discourse-cdn.com/meta/original/4X/8/7/3/8738849306ee0cbb0ed949dd697eee31a9b8d98a.png)

It seems not to be related to [authorized tags](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/pretty-text/addon/allow-lister.js#L115), since Discourse accepts all these tags (`<strike>`, `<s>`, `<b>`, `<strong>`, `<i>`, `<em>`…).

It seems not to be a markdown-it quirk either, since I can’t reproduce the issue in [their demo](https://markdown-it.github.io/).

* * *

1. Note that `<strike>` is deprecated in favor of `<s>` . A detail that won’t change anything in this issue, but always good to know… I just learned it right now after all 😄

---

_[View the full topic](https://meta.discourse.org/t/markdown-preview-and-result-differ/263878)._
