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

In the question list http://mathematica.stackexchange.com/questions/tagged/evaluation, I saw the question Pre and Post in a Block[] displaying incorrectly.

The question displays correctly on the question page itself.

That question's body is:

Why does

    Block[{$Pre = ( 1 + #) &}, 1]
produce `1` while

    Block[{$PreRead = Print["hi"]}, 1]
produces

    "hi"
    1
?
In the `Block` block, shouldn't the expression have it's `Pre` evaluation as well?

It shows up in the list as:

Weird box thingy

The HTML of the excerpt in the question list is

        <h3><a href="/questions/13501/pre-and-post-in-a-block" class="question-hyperlink">Pre and Post in a Block[]</a></h3>
        <div class="excerpt">
            Why does

Block[{$Pre = ( 1 + #) &amp;}, 1]


produce 1 while

Block[{$PreRead = Print["hi"]}, 1]


produces

"hi"
1


?
In the Block block, shouldn't the expression have it's Pre evaluation as well?

        </div>

which is what you expect (no weird box). It seems that Mathjax is misinterpreting the $ signs in the code and trying to render it as an equation.

This bug probably occurs on any site that has Mathjax enabled, but Mathematica.SE is most likely to see the issue since it uses both $math$ and code containing $ signs.

Similar to these issues (but distinct, since both are fixed):

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Tricky.

We strip out html tags when building a post's summary, so the normally MathJax suppressing <code> tags aren't there.

Starting in the next build we'll start wrapping things that were once wrapped in code in style-less (but still MathJax suppressing) elements, so this problem shouldn't happen anymore.

share|improve this answer
    
It's now working properly. –  Mechanical snail Nov 22 '12 at 6:33

You must log in to answer this question.

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