4
\$\begingroup\$

A question posted by another user has somehow triggered MathJax on the search page, but only when searching for the user and the tag that is on the question that is posted.

Go to search and type in user:166972 [shell] and you will see the following:

Error Picture

If you do a tag search for or it shows properly:

No MathJax


On mobile when I clicked the link given by Peter's answer this is what I saw

enter image description here

So it is doing something similar here as well I have Android 7

\$\endgroup\$
4
  • \$\begingroup\$ I don't think the tags fix the bug. Instead, they will show the start of the answer instead of the parts where shell is mentioned. We need an answer/question that contains \$ in its code in the first few bytes to check whether the tags are important. \$\endgroup\$
    – Zeta
    Apr 21, 2018 at 6:36
  • 1
    \$\begingroup\$ I just checked another query where inline code was included. That gets marked with <span class="tex2jax_ignore"> (not <code>) again. Code blocks usually get ellipsed on tag searches, so I'm not sure a) why they're shown in sineemore's query, and b) why sineemore's query shows content from the middle. \$\endgroup\$
    – Zeta
    Apr 21, 2018 at 6:42
  • \$\begingroup\$ if you search by [shell] it shows up correctly, but if you add the user parameter, that is when it shows incorrectly \$\endgroup\$
    – Malachi Mod
    Apr 21, 2018 at 15:16
  • \$\begingroup\$ it could actually be bleed over from the previous set of elements on the one search page, versus the other search page. meaning that the user's post that appears before it in the list of results could have the affect on the post after it. without having access to the code I couldn't tell you for sure \$\endgroup\$
    – Malachi Mod
    Apr 21, 2018 at 15:23

1 Answer 1

4
\$\begingroup\$

An excerpt is selected from the post to highlight the keywords in context, and subsequent edits to the answer mean that the snippets chosen are now different and the problem is not reproduced. Basically the keyword "shell" was added earlier in the post, and so the text around that addition is chosen in preference. After a bit of trial and error I've found a different search which reproduces the problem: user:166972 exec. The relevant source from the search result page is

            <div class="excerpt">
                 base64 &gt;/dev/null 2&gt;&amp;1 &amp;&amp; base64 -d
    }
};
case &quot;\$SHELL&quot; in
	*/bash*)
		eval \$(printf &#39;%s&#39; &quot;$_XSSH_BASH&quot; | base64_decode)
        ;;
    *)
        test -x &quot;\$SHELL&quot; &amp;&amp; <span class="result-highlight">exec</span> &quot;\$SHELL&quot; -il || <span class="result-highlight">exec</span> &hellip; 
            </div>

After MathJax processing this is rendered as

<div class="excerpt">
                 base64 &gt;/dev/null 2&gt;&amp;1 &amp;&amp; base64 -d
    }
};
case "<span class="MathJax_Preview" style="color: inherit; display: none;"></span><span class="MathJax" id="MathJax-Element-1-Frame" tabindex="0" data-mathml="<math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;><mi>S</mi><mi>H</mi><mi>E</mi><mi>L</mi><mi>L</mi><mo>&amp;quot;</mo><mi>i</mi><mi>n</mi><mo>&amp;#x2217;</mo><mrow class=&quot;MJX-TeXAtom-ORD&quot;><mo>/</mo></mrow><mi>b</mi><mi>a</mi><mi>s</mi><mi>h</mi><mo>&amp;#x2217;</mo><mo stretchy=&quot;false&quot;>)</mo><mi>e</mi><mi>v</mi><mi>a</mi><mi>l</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1" style="width: 14.643em; display: inline-block;"><span style="display: inline-block; position: relative; width: 11.79em; height: 0px; font-size: 124%;"><span style="position: absolute; clip: rect(1.43em, 1011.73em, 2.795em, -999.997em); top: -2.354em; left: 0em;"><span class="mrow" id="MathJax-Span-2"><span class="mi" id="MathJax-Span-3" style="font-family: MathJax_Math-italic;">S<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.065em;"></span></span><span class="mi" id="MathJax-Span-4" style="font-family: MathJax_Math-italic;">H<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.065em;"></span></span><span class="mi" id="MathJax-Span-5" style="font-family: MathJax_Math-italic;">E<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mi" id="MathJax-Span-6" style="font-family: MathJax_Math-italic;">L</span><span class="mi" id="MathJax-Span-7" style="font-family: MathJax_Math-italic;">L</span><span class="mo" id="MathJax-Span-8" style="font-family: MathJax_Main; padding-left: 0.251em;">"</span><span class="mi" id="MathJax-Span-9" style="font-family: MathJax_Math-italic; padding-left: 0.251em;">i</span><span class="mi" id="MathJax-Span-10" style="font-family: MathJax_Math-italic;">n</span><span class="mo" id="MathJax-Span-11" style="font-family: MathJax_Main; padding-left: 0.251em;">∗</span><span class="texatom" id="MathJax-Span-12" style="padding-left: 0.251em;"><span class="mrow" id="MathJax-Span-13"><span class="mo" id="MathJax-Span-14" style="font-family: MathJax_Main;">/</span></span></span><span class="mi" id="MathJax-Span-15" style="font-family: MathJax_Math-italic;">b</span><span class="mi" id="MathJax-Span-16" style="font-family: MathJax_Math-italic;">a</span><span class="mi" id="MathJax-Span-17" style="font-family: MathJax_Math-italic;">s</span><span class="mi" id="MathJax-Span-18" style="font-family: MathJax_Math-italic;">h</span><span class="mo" id="MathJax-Span-19" style="font-family: MathJax_Main;">∗</span><span class="mo" id="MathJax-Span-20" style="font-family: MathJax_Main;">)</span><span class="mi" id="MathJax-Span-21" style="font-family: MathJax_Math-italic;">e</span><span class="mi" id="MathJax-Span-22" style="font-family: MathJax_Math-italic;">v</span><span class="mi" id="MathJax-Span-23" style="font-family: MathJax_Math-italic;">a</span><span class="mi" id="MathJax-Span-24" style="font-family: MathJax_Math-italic;">l</span></span><span style="display: inline-block; width: 0px; height: 2.36em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.381em; border-left: 0px solid; width: 0px; height: 1.388em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>S</mi><mi>H</mi><mi>E</mi><mi>L</mi><mi>L</mi><mo>"</mo><mi>i</mi><mi>n</mi><mo>∗</mo><mrow class="MJX-TeXAtom-ORD"><mo>/</mo></mrow><mi>b</mi><mi>a</mi><mi>s</mi><mi>h</mi><mo>∗</mo><mo stretchy="false">)</mo><mi>e</mi><mi>v</mi><mi>a</mi><mi>l</mi></math></span></span><script type="math/tex" id="MathJax-Element-1">SHELL" in
    */bash*)
        eval </script>(printf '%s' "$_XSSH_BASH" | base64_decode)
        ;;
    *)
        test -x "\$SHELL" &amp;&amp; <span class="result-highlight">exec</span> "\$SHELL" -il || <span class="result-highlight">exec</span> … 
            </div>

You can see two \$ which in the full answer are inside a code block but in the excerpt are not: this is what triggers the undesired MathJax processing. I find it curious that the later pair of \$ doesn't also trigger it: perhaps this is due to the intervening result-highlight span.

Screenshot:

screenshot showing the excerpt as rendered

\$\endgroup\$
8
  • \$\begingroup\$ The original is still happening, just not as much MathJax is showing through. the preview is still broken as it skips over the first paragraph and into the second paragraph \$\endgroup\$
    – Malachi Mod
    Apr 26, 2018 at 14:33
  • \$\begingroup\$ @Malachi, what I see for the original is "deeper, so one may say it is self-reproducing. I use it for a year or so, code works fine. Things I worry about: fallback behaviour when there is no bash shell base64 is required on host system to be … used as alias ssh=xssh script must behave similary to ssh overal code style and consistence in last HEREDOC I try to determine if current shell is bash. If not, I try to fallback to normal shell (w/o …" with no MathJax at all. \$\endgroup\$ Apr 27, 2018 at 11:46
  • \$\begingroup\$ What browser are you using. I am using chrome and I see some words in bold. \$\endgroup\$
    – Malachi Mod
    Apr 27, 2018 at 12:18
  • \$\begingroup\$ @Malachi, that's not MathJax. That's the search results highlighting the search terms. \$\endgroup\$ Apr 27, 2018 at 12:19
  • \$\begingroup\$ Lol, I will look again I thought I saw italics too. I am mobile at the moment. \$\endgroup\$
    – Malachi Mod
    Apr 27, 2018 at 12:25
  • \$\begingroup\$ I am seeing the Keyword highlighting, but it is still skipping a paragraph and a half for the preview, which is not the correct behavior either. \$\endgroup\$
    – Malachi Mod
    Apr 27, 2018 at 12:39
  • \$\begingroup\$ I wonder if it does that because it tries to show a preview from where the keywords are. \$\endgroup\$
    – Malachi Mod
    Apr 27, 2018 at 12:40
  • \$\begingroup\$ Yes: that's why it took some trial and error to find a keyword which gave the right excerpt. Sorry, I thought that was obvious so I didn't go into detail. \$\endgroup\$ Apr 27, 2018 at 17:30

You must log in to answer this question.

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