Another workaround is $\lbrace a,b \rbrace$
. It's more verbose than $\\{ a,b \\}$
, but has the advantage that it works regardless of whether this bug is triggered or not.
In any case, this bug has apparently been fixed at some point within the past six years. The Markdown code $\{ a,b \}$
now produces $\{ a,b \}$, just as it should.
Note that, since the Markdown to HTML conversion is done only once when a post is submitted or edited, old posts that have not been edited since this bug was fixed will continue to render as they used to. However, any edits to such posts will cause the Markdown source to be reparsed, so that $\{ a,b \}$
will start working while $\\{ a,b \\}$
will break.
\\{
to avoid this problem; thus one always has to check for braces going missing. I recently saw a post that was incomprehensible because the braces around a set were missing. Note also that this isn't specific to parentheses; you can put almost any non-space character before or after the dollar signs to trigger it. $\endgroup$