Backslashes

Posted by Worstje on Tue 27 Jul 2010 10:26 AM — 8 posts, 38,295 views.

Netherlands #0
When Forum Codes are checked in a post, the forum decides to eat one 'layer' of backslashes out of the post when reading it, no matter whether it is inside a tag or not. In the edit screen however everything will appear allright.

This is something I have never seen in any other forum, nor do I see any reason in the Forum Codes or Templates to explain that kind of behaviour in turn for a feature of sorts.

It makes posting code examples very confusing, and in my opinion should be removed.

Examples (this post has forum codes turned OFF):

One backslash: \
Two backslashes: \\
Three backslashes: \\\
Four backslashes: \\\\
Netherlands #1
Examples (this post has forum codes turned ON):

One backslash: \
Two backslashes: \
Three backslashes: \\
Four backslashes: \\


For examples of the confusion the above can cause, see: http://www.gammon.com.au/forum/?id=10451&page=999#62400
Amended on Tue 27 Jul 2010 10:30 AM by Worstje
Australia Forum Administrator #2
As I explained in that post, since forum codes use square brackets, we must have a way of putting the forum codes literally in, eg.


Please use the [code] tag.


To do that I had to post:


Please use the \[code\] tag.


And since we are using backslashes in order to display square brackets, we must have a way of displaying backslashes themselves. So, we have to put two backslashes in the forum posts, if forum codes are turned on, for every one we want to see.
Netherlands #3
Right. I guess that explains the why. I still can't say I'm convinced about the logic though.

I write most snippets impromptu in my browser. Half the time I won't even have access to MUSHclient, or go through the entire motion for testing since I just want to help people along and get started.

Newer or less frequent users won't understand why their posts miss the backslashes either. It only adds to the confusion.

I would ask myself this: what will a person do more often? Discuss how to use forum codes, or write regular expressions in their posts? And regarding the [code] tag - you added a very useful template for that exact statement: [codetag].

Template:codetag
To make your code more readable please use [code] tags as described here.


At most, you've given people a good reason not to use the [code] tag. :)
Amended on Wed 28 Jul 2010 03:19 AM by Worstje
USA #4
Quickie solution: add a "Convert forum codes" button to the post form that runs some Javascript to convert the current contents of the input box. This would be the best balance of easy and user-friendly, IMHO. Or you could just make the button post to the server and have the server fix up the output before rendering the page again with the fixed content in the input box.

(Honestly, the forum is a better place than MUSHclient to put such a feature anyways.)
Australia Forum Administrator #5
Worstje said:

At most, you've given people a good reason not to use the [code] tag. :)


It's not just the [code] tag, it's any tags. And if your code happens to have [i] in it (as in: a = b [i] ) then that switches forum codes on, and it will turn the rest of the post into italics.
Amended on Wed 28 Jul 2010 05:06 AM by Nick Gammon
USA #6
The obvious solution is to have your webhost provide luacgi, and do the forum tags and escaping in LPEG... ;)
Australia Forum Administrator #7
Ah I was hoping LPEG could be worked into this somehow. ;)