Quantcast
Channel: Active questions tagged code-formatting - Meta Stack Overflow
Viewing all articles
Browse latest Browse all 189

HTML formatting inside highlighted code blocks is no longer supported - how can I fix my posts?

$
0
0

In the past, it used to be possible to apply rich text formatting to text inside code blocks, as long as the code block was formatted using the HTML <pre><code> elements. As an example, the following code in a post:

<pre><code>.This is <b>bold</b>, <i>italic</i>, and <strike>striked-out</strike> text..</code></pre>

...would display as:

.This is bold, italic, and striked-out text..

Notice that the HTML tags would actually be applied and format the text as indicated.

This used to work in the past for all posts, but now seems to be broken. In most cases, that text now looks like:

.This is bold, italic, and striked-out text..

It seems that the HTML elements are being completely stripped out rather than being applied to text, or even rendered as text.

  • It used to work fine for many years; why is it now broken?
  • When making or editing a post, it tends to render as it did before, with formatting applied, but unexpectedly changes when the post is saved. Why is this happening?
  • It still works in some posts! Why is this post affected, but this other post not?

This post is meant as a public service announcement, as well as a duplicate target for anyone who asks about this problem here. While posts that make use of this feature are rare, I feel this is still worthwhile posting given this staff comment remarking how this feature worked for many, many years. It also serves as a reference as to how to fix broken posts.


Viewing all articles
Browse latest Browse all 189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>