6
$\begingroup$

In this answer, I noticed a math bug that looks like an interaction between the parser and the TeX system. When you have a word that starts with math and then has italics or bold later, the italics or bold is formatted correctly in the preview, but not formatted correctly in the final output of the answer.

For example, if you type $x$-**word**, what you get in the preview is the letter $x$ followed by word in bold, as desired. However, in the final output you get $x$ followed by *word* in italics, not bold, with visible asterisks.

Similar problems happen if you enter $x$-*word*. In that case you don't get any italics in the final output, just two visible asterisks.

I need to point out that putting the bold in front, like **$x$-word** isn't a solution, because that makes the symbol $x$ bold. There are cases in mathematics where the bold actually has a semantic value, and even when it doesn't the standard convention is not to put math in a bold font.

Also, I hit another difference between the preview display and the final display when editing the previous paragraph: if you remove the second backslash and compare preview to final output you will see it.

$\endgroup$
  • 1
    $\begingroup$ Oh, like this and this? $\endgroup$ – J. M. is a poor mathematician Dec 20 '10 at 13:42
  • $\begingroup$ Part of this maybe related to the broken regexp observed before. $\endgroup$ – Willie Wong Dec 20 '10 at 13:47
  • $\begingroup$ @J.M.: Strange, at the first like it says "status-completed" ... $\endgroup$ – Hendrik Vogt Dec 20 '10 at 13:48
  • $\begingroup$ @J.M. it is probably related, but different. As in the first thread you linked to it appears that a fixed has already been deployed for that bug. $\endgroup$ – Willie Wong Dec 20 '10 at 13:48
  • $\begingroup$ Let's see how it is in comments: $\LaTeX$-italic and $\LaTeX$-bold ... yeah, it's worse here. Maybe use \textbf for the time being? $\endgroup$ – J. M. is a poor mathematician Dec 20 '10 at 13:51
  • $\begingroup$ @J. M.: Thanks, I looked but didn't find those. However, the first one is marked "completed", while this is still broken. The difference may be the space (or lack of space) between TeX and markdown. (I will also add a markdown tag to my question.) $\endgroup$ – Carl Mummert Dec 20 '10 at 14:18
  • $\begingroup$ @Willie Wong: do they really use regexes to implement markdown? $\endgroup$ – Carl Mummert Dec 20 '10 at 14:20
  • 1
    $\begingroup$ Well, I am not the brightest bulb when it comes to programming, but how else do you implement/parse a mark-up language besides searching for and pairing delimiters? $\endgroup$ – Willie Wong Dec 20 '10 at 14:59
  • 1
    $\begingroup$ @Willie Wong: the stereotypical way to parse a programming language is to break up the input into a stream of tokens with a "lexer", then use a parser to make a parse tree. Sometimes it is possible to just make in-text replacements using regular expressions, but for more complicated languages the code can be much more complicated. See en.wikipedia.org/wiki/Parsing#Overview_of_process for a summary. I have no idea what system is used for the stackexchange engine, but this problem looks more like a "lexer" error than a "parser" error. $\endgroup$ – Carl Mummert Dec 20 '10 at 16:13
3
$\begingroup$

Tricky.

Basically, the - was getting eaten in a processing pass* causing us to treat the *italic* or **bold** as intra-word (and thus ignored). This has been fixed on dev, and should go out sometime tonight.

Naturally, only new or edited posts will be affected.

*Most of our markdown implementation is open source. And yes, it is sadly mostly regular expressions glued together. Markdown is shockingly resistant to classical compilation. The spec is rather... non-technical.

$\endgroup$

You must log in to answer this question.

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