17
$\begingroup$

Somewhat of a duplicate of http://meta.math.stackexchange.com/questions/419/editing-a-question-containing-formulae-will-remove-the-formulae.
I reposted the question because the previous one
- had a misleading title
- was marked status-completed (possibly based on the title)
- has an accepted answer,
all of which make it look like a resolved issue.

Commenting with, say, $x^2 + x - 3x$ and then editing the comment, you will see x2+x−3xx^2 + x - 3x

An explanation was given by KennyTM in the accepted answer to the previous question:
The raw code of the comment you're going to edit is stored in a hidden <div>:

<form class="dno" id="edit-comment-1029" style="display: none;">
  <div class="dno">
    Testing $\LaTeX$ **and** `formatting`.
  </div>
</form>

the text content of this <div> is retrieved and put in the comment editing text box when you click "edit".

However, a <div class="dno"> is not one of the exclusion in TeXification, so the script will turn the $\LaTeX$ into an image in this hidden <div>:

<form class="dno" id="edit-comment-1029" style="display: none;">
  <div class="dno">
    Testing
    <img src="http://chart.apis.google.com/..." alt="$\LaTeX$">
    **and** `formatting`.
  </div>
</form>

Because an image is not text, when retrieving the text content the formula will be gone.

You can try to adblock http://sstatic.net/js/third-party/math-tex.js (thus disable TeXifying) and see that the problem is “fixed”.

Edit: Problem still exists in MathJax, but instead of just the image, it becomes this mess:

<div class="dno">
  Testing
  <span class="MathJax_Preview" style="display: none;"></span><span class="MathJax" role="textbox" aria-readonly="true" style=""><nobr style=""><span class="math" id="MathJax-Span-26"><span style="display: inline-block; position: relative; width: 2.603em; height: 0pt; font-size: 128%;"><span style="position: absolute; top: -2.757em; left: 0em; clip: rect(1.845em, 1000em, 3.169em, -0.554em);"><span class="mrow" id="MathJax-Span-27"><span class="mi" id="MathJax-Span-28" style="font-family: MathJax_Math; font-style: italic;">L</span><span class="mspace" id="MathJax-Span-29" style="height: 0em; vertical-align: 0em; margin-left: -0.325em;"></span><span class="mpadded" id="MathJax-Span-30"><span style="display: inline-block; position: relative; width: 0.521em; height: 0pt;"><span style="position: absolute; top: -2.967em; left: 0em; clip: rect(2.055em, 1000em, 2.952em, -0.561em);"><span class="mrow" id="MathJax-Span-31"><span class="texatom" id="MathJax-Span-32"><span class="mrow" id="MathJax-Span-33"><span class="mrow" id="MathJax-Span-34"><span class="texatom" id="MathJax-Span-35"><span class="mrow" id="MathJax-Span-36"><span class="mi" id="MathJax-Span-37" style="font-size: 70.7%; font-family: MathJax_Math; font-style: italic;">A</span></span></span></span></span></span></span><span style="display: inline-block; width: 0pt; height: 2.757em;"></span></span></span></span><span class="mspace" id="MathJax-Span-38" style="height: 0em; vertical-align: 0em; margin-left: -0.17em;"></span><span class="mi" id="MathJax-Span-39" style="font-family: MathJax_Math; font-style: italic;">T</span><span class="mspace" id="MathJax-Span-40" style="height: 0em; vertical-align: 0em; margin-left: -0.14em;"></span><span class="mpadded" id="MathJax-Span-41"><span style="display: inline-block; position: relative; width: 0.716em; height: 0pt;"><span style="position: absolute; top: -2.542em; left: 0em; clip: rect(1.882em, 1000em, 2.953em, -0.556em);"><span class="mrow" id="MathJax-Span-42"><span class="texatom" id="MathJax-Span-43"><span class="mrow" id="MathJax-Span-44"><span class="mi" id="MathJax-Span-45" style="font-family: MathJax_Math; font-style: italic;">E</span></span></span></span><span style="display: inline-block; width: 0pt; height: 2.757em;"></span></span></span></span><span class="mspace" id="MathJax-Span-46" style="height: 0em; vertical-align: 0em; margin-left: -0.115em;"></span><span class="mi" id="MathJax-Span-47" style="font-family: MathJax_Math; font-style: italic;">X</span></span><span style="display: inline-block; width: 0pt; height: 2.757em;"></span></span></span><span style="border-left: 0em solid; display: inline-block; overflow: hidden; width: 0pt; height: 1.152em; vertical-align: -0.276em;"></span></span></nobr></span>
  <script type="math/tex" id="MathJax-Element-2">\LaTeX</script>
  **and** `formatting`.
</div>

This leads to Testing LATEX\LaTeX **and** ‘formatting‘ in the text box. The first LATEX is the TeXified result, and second \LaTeX is from the <script type="math/tex">.

$\endgroup$
  • 1
    $\begingroup$ I suspect, though I do not know for sure, that explanation given by KennyTM applied when TeX was being rendered by Google Charts, but is not quite what's happening now with MathJax. $\endgroup$ – Isaac Aug 5 '10 at 6:07
  • 1
    $\begingroup$ @Isaac: Actually the reason is the same. See my update in that answer. $\endgroup$ – kennytm Aug 5 '10 at 19:59
  • $\begingroup$ @KennyTM: I agree with your updated answer there, but what's quoted here is just the original part about the images, which isn't the case with MathJax. $\endgroup$ – Isaac Aug 5 '10 at 20:26
4
$\begingroup$

(Technique copied from Allow TeXification in <code> tags.)

This problem can be solved by adding the option

tex2jax: {
  ignoreClass: "tex2jax_ignore|dno"
}

in the config.

$\endgroup$
  • 1
    $\begingroup$ I have added this to the config - please let me know if it works. This will be pushed out in our next deployment (tomorrow evening). $\endgroup$ – Geoff Dalgas Sep 11 '10 at 6:49
  • 2
    $\begingroup$ @Geoff: It works! Thanks. $\endgroup$ – kennytm Sep 11 '10 at 13:13
5
$\begingroup$

I'm just bumping this up. This bug still exists, and is very annoying. Is someone looking into this? Will it ever be fixed? Given that the fix (see KennyTM's answer) seems to something as simple as changing a line in the config, is it taking so long because the fix hasn't been noticed, or no one cares? :-(

$\endgroup$
2
$\begingroup$

This problem is back, and now editing a comment including latex replaced the equation with a Unicode rendition of the formula followed by the tex code itself, without the $'s.

$\endgroup$

You must log in to answer this question.

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