# XML not visible in post

**URL:** <https://meta.discourse.org/t/xml-not-visible-in-post/89962>\
**Category:** Product Support\
**Created:** [June 15, 2018, 11:04am UTC](https://meta.discourse.org/t/xml-not-visible-in-post/89962 "2018-06-15T11:04:11Z")\
**Posts on this page:** 7\
**Page:** 1

## AI-generated summary

In a [Support](/t/-/89962) category thread titled "XML not visible in post," [Ivan_Rapekas](/t/-/89962/1) reports that XML code in their post is invisible, sharing an example of the markup. [codinghorror](/t/-/89962/2) explains this is by design — Markdown interprets raw XML as illegal HTML unless wrapped in a code block. [Ivan_Rapekas](/t/-/89962/3) suggests a helpful warning during posting to remind users to use triple backticks for code. [sam](/t/-/89962/4) notes this is a significant issue but unlikely to be added to Discourse core, though it could be a plugin using complex regex or parsing. [codinghorror](/t/-/89962/5) adds that Stack Overflow does auto-detect code because the cost of not doing so on a programming site is too high, and this topic has been extensively discussed. [sam](/t/-/89962/6) closes the thread, referencing a [meta topic](https://meta.discourse.org/t/easy-way-to-change-preformatted-text-code-button/16760) on code formatting, reaffirming the behavior is intentional.

<div class="post-metadata">

**Author:** ![Ivan\_Rapekas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ivan_rapekas/32/248924_2.png) [@Ivan\_Rapekas](https://meta.discourse.org/u/Ivan_Rapekas)\
**Post date:** [June 15, 2018, 11:04am UTC](https://meta.discourse.org/t/xml-not-visible-in-post/89962/1 "2018-06-15T11:04:11Z")

</div>

Hi, there is invisible XML block below.

Here is the end of XML block.

---

<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:** [June 15, 2018, 11:10am UTC](https://meta.discourse.org/t/xml-not-visible-in-post/89962/2 "2018-06-15T11:10:27Z")

</div>

This is by design, and how Markdown works.. put it in a code block unless you want it to be interpreted as illegal non-whitelisted html.

---

<div class="post-metadata">

**Author:** ![Ivan\_Rapekas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ivan_rapekas/32/248924_2.png) [@Ivan\_Rapekas](https://meta.discourse.org/u/Ivan_Rapekas)\
**Post date:** [June 15, 2018, 11:14am UTC](https://meta.discourse.org/t/xml-not-visible-in-post/89962/3 "2018-06-15T11:14:54Z")

</div>

Though I expected this behavior, I would like to have a small warning during posting like this: ‘Your message contains a code, consider to put it in a code block using triple back quotes (unless …)’ 🙂

---

<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:** [June 20, 2018, 1:02am UTC](https://meta.discourse.org/t/xml-not-visible-in-post/89962/4 "2018-06-20T01:02:36Z")

</div>

This is a pretty enormous problem. I do not see Discourse core adding such a feature for “automatic code block missing” warning. Not sure if even Stack Overflow do this.

But … it is an interesting idea for a plugin, which would have to use some very fancy regex mountain or a custom parser of sorts.

---

<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:** [June 20, 2018, 3:12am UTC](https://meta.discourse.org/t/xml-not-visible-in-post/89962/5 "2018-06-20T03:12:22Z")

</div>

This has been covered at _EXTREME_ length in other topics about “auto detecting code when a user can’t figure out how to properly format code”

And yes SO does do this, because the cost of not doing it on a _site about programming_ was super high.

---

<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:** [June 20, 2018, 3:19am UTC](https://meta.discourse.org/t/xml-not-visible-in-post/89962/6 "2018-06-20T03:19:30Z")

</div>

closing this as … by design and covered at:

> [@Easy way to change preformatted text (code) button?](https://meta.discourse.org/t/easy-way-to-change-preformatted-text-code-button/16760):
>
> On forums that are pretty software intensive, i.e., people posting lots of code… the preformatted text ctrl+k thing doesn’t cut it. I’m constantly having to edit posts and do this technique: Is there an easy way to just change this button to be the CODE button and default it to whatever makes sense for your community? There is no amount of tutorials that can fix this problem… the problem is people look at the tools in front of them and the pick the one with CODE in it. Which turns …

---

<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:** [June 20, 2018, 3:19am UTC](https://meta.discourse.org/t/xml-not-visible-in-post/89962/7 "2018-06-20T03:19:33Z")

</div>

Closed on June 20, 2018, 3:19am UTC


