[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  Forum
. -> [Folder]  Problems
. . -> [Subject]  Backslashes
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Backslashes

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Tue 27 Jul 2010 10:26 AM (UTC)
Message
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: \\\\
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #1 on Tue 27 Jul 2010 10:26 AM (UTC)

Amended on Tue 27 Jul 2010 10:30 AM (UTC) by Worstje

Message
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
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Tue 27 Jul 2010 09:27 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #3 on Wed 28 Jul 2010 03:17 AM (UTC)

Amended on Wed 28 Jul 2010 03:19 AM (UTC) by Worstje

Message
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. :)
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #4 on Wed 28 Jul 2010 03:26 AM (UTC)
Message
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.)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Wed 28 Jul 2010 04:12 AM (UTC)

Amended on Wed 28 Jul 2010 05:06 AM (UTC) by Nick Gammon

Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Reply #6 on Wed 28 Jul 2010 05:36 AM (UTC)
Message
The obvious solution is to have your webhost provide luacgi, and do the forum tags and escaping in LPEG... ;)
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Wed 28 Jul 2010 05:39 AM (UTC)
Message
Ah I was hoping LPEG could be worked into this somehow. ;)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


7,777 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]