What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 122 Stack Exchange communities.

After adding language hints to various answers to this question, I discover that the affected code blocks are shown with all their whitespace collapsed in the rendered diffs in my activity tab... and only there:

On closer inspection it appears that the <pre> tags are missing from the second snippet, which is what's causing the whitespace to collapse.

The revision history for the post depicted above looks fine.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Fixed in the next build (and retroactively so, since those diffs aren't cached).

Getting the diff for the activity list accidentally Markdown-converted the post text twice. That's usually not an issue, since the Markdown conversion is mostly idempotent (and that's why, despite being broken for one and a half years, this has only been noticed now). When syntax highlighting hints come into play however, this idempotence is gone.

The first conversion adds the class="lang-foo" prettify information. The second conversion sees a class attribute on a <pre> tag, which the HTML sanitizer doesn't allow. And unlike in the first conversion, where we know that the class attribute was created by the conversion and thus is exempt, in the second conversion it looks like user-supplied, disallowed HTML, and hence the <pre> tag is removed by the sanitizer.

share|improve this answer
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .