Using backslash to escape has buggies . .

Since we seem to have @codinghorror’s attention today, here is a bug I’ve seen often:

Using the backslash character to, e.g. prevent © from appearing as © doesn’t work consistently. You can see that in the immediately previous sentence – there IS a backslash before the left parenthesis in the first © and this one too. In my experiments with this, it works thoroughly inconsistently, as far as I can tell. Putting backslash before both parentheses as in © sometimes fixes it, but not always. The only rule I can see is that having © more than once in one paragraph seems to affect how any other instances of © or ® or any of the others appear in the same paragraph.

I suspect this happens because the JS code doesn’t parse a paragraph of text in character-by-character left-to-right order, but instead probably does some kind of pattern-matching on the entire text at once.

(No, Discourse, my topic is not similar to “Are there any Roman amphitheatres that have seen constant use?”)

OK cool, let’s see.

(c) makes ©
(r) makes ®
(tm) makes ™

\(c\) makes (c)
\(r\) makes (r)
\(tm\) makes (tm)

But this is all single-line stuff as you noted, and also you must escape both of them with the backslash, escaping only one is a recipe for… badness.

I kinda wish -> turned into → by itself as well… I need to add that to our to-do list.

In the example paragraph I wrote above, there were examples of © with back-slash before both parentheses and it still appeared as ©. Here is one: ©. How about backslash only before the second parenthesis, like this: ©? In other attempts I’ve made to investigate this, I couldn’t get consistent results, at least not according to any straightforward rule that I could see.

The case of © in particular comes up a lot when people try to make a list of items
(a) like this one and
(b) like this one too and
© We still miss you Opal and
(d) also like this one,

and it’s really tricky (if possible at all) to make the third item appear correctly.

But now compare the following to the above:

The case of © in particular comes up a lot when people try to make a list of items
(a) like this one and
(b) like this one too and

(c) We still miss you Opal and
(d) also like this one,

See what’s different here?

I mentioned it in another thread, but this seems like a good time to suggest it again. IMHO, there should be some special character or sequence of characters, that, when typed, will trigger the software to parse whatever immediately follows it as code or a special character or whatever. It should not be the case that a special character or sequence of characters is used similarly to noparse tags.

To me, the way it currently is, would be like if MS Word would automatically underline any word that started with the letter u, unless I explicitly told it not to. So if I wanted to write the word underline, I’d have to write \underline, so I don’t get nderline instead.

In other words, the default should be that what I type is what appears in my post.

What Joey_P says would really have been the better way, but it’s way too late for that now.

Discourse actually implements a hodge-podge of subsets of three different markup styles: vBcode, Markdown, and bare-naked HTML. (I still use vBcode because I know it the best.)

With a massive base of existing posts (and that’s on SDMB alone, let alone on all the other Discourse boards), I can’t imagine how that can be changed now.

Hmm, let me see

(a) one
(b) two
(c) three
(d) four

What’s so difficult about this? I’m not really following:

(a) one
(b) two
\(c\) three
(d) four

Or in the same sentence? (a) one (b) two (c) three (d) four

aka

Or in the same sentence? (a) one (b) two \(c\) three (d) four

But compare with post #3 above. See the problem there? Here it is again, abbreviated: There are problems with ©:
© Both parentheses have backslashes on this line.

Let me teach you another trick, just because I like y’all:

https://boards.straightdope.com/raw/923748/8

that says you posted

But compare with post #3 above.  See the problem there?  Here it is again, abbreviated:  There are problems with (c):
\(c\) Both parentheses have backslashes on this line.

Let’s experiment!

\(c\) \(c\)

produces

(c) (c)

which is fine

\(c\) and \(c\)

produces

(c) and (c)

also fine, and

\(c\)
\(c\)

produces

(c)
(c)

also fine, but

(c)
\(c\)

produces

©
©

So if the line immediately above contains a non-escaped version, the escaped version directly underneath dosn’t work? Yes, certainly a bug, but it’s such a narrow range of problem that I even wonder how it was discovered??

There seem to be two bugs:
(1) As you noted, escaping the left parenthesis without escaping the right parenthesis doesn’t work.
(2) But also: If © or any of the others like ® or similar appear in a paragraph, then any other occurrences of any of those in the same paragraph, even with proper backslashing will appear as ©, ®, etc.

OK let me be clear that I am on board with this being a bug for sure, but is this really causing problems in actual posts? I feel like I’m being dragged through the streets of hypothetical-theoretical-potential-problem-town.

But this is not a bug. You’d need to escape both to expect it to work.

I don’t recall the specific posts where I’ve seen it, but I’ve definitely seen it several times, including in posts I’ve made and in posts that others have made.

It’s noticeable in making lists where (c) appears as a copyright symbol instead. But in what cases does this happen? Since it might be a bit uncommon for it to appear twice in one paragraph (except of course in paragraphs where we’re talking about copyright symbols), I’m thinking there must be other cases that cause this. How about, when I see it again, I’ll let you know. It’s not altogether uncommon.

It is a very fine bug. I respect the effort that went into finding it and reporting it. I’m also impressed since I’ve never actually seen this one reported before, and it’s probably been around since the very first days of Discourse (that’d be 2013).

But we also do try to prioritize fixing things that have the most impact on real world usage, because like all open source software there is a lot of breakage… figurative… conceptual… and actual.

We also strive to expend most of our effort building new stuff, new features, and enhancements. You can see the roadmap at https://meta.discourse.org/c/releases/30

It’s fun watching you making edits to your post even as I’m reading it. When you edit a post, I see the change immediately right before my very eyes!

Fun is an explicit goal in Discourse, as well, so that’s good :tada:

Why would you hang out somewhere that you weren’t having fun?

Cause my boss is paying me to?

It’s also because I’m a (retired) programmer, and I had a long history of finding and sometimes precisely diagnosing (often subtle) bugs in other peoples’ programs without ever even seeing their source code.