Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

angelwatt

Moderator emeritus
Original poster
Aug 16, 2005
7,852
9
USA
I noticed something weird when doing a post earlier. Some BBCode (or whatever the styling is called) was causing the text inside to become all lowercase. Anyone know if this is a "feature" of the syntax or something else happening? The examples below shows the same text except the first line doesn't end with a semicolon and the last example. The J and S should be uppercase in each case. As you can see when wrapping the text with bold or italics causes the text inside to become all lowercase. I haven't tried other tags though. The real funny thing is, it only seems to apply to the word JavaScript.

JavaScript
JavaScript:
JavaScript:
JavaSc:

I see also that the resulting HTML created for the above looks like,
HTML:
<b>JavaScript</b><br>
<b>javascript<b></b>:</b><br>
<i>javascript<b></b>:</i><br>
<b>JavaSc:</b><br>
which is showing an extra bold tag right before the semicolon. That doesn't really shed much light on it though, for me at least.
 
I can confirm that this quirk exists. I entered each of the following lines with an initial uppercase J, but four of them come out in lowercase when the post is displayed. It's specific to the word JavaScript, since for security the forum system must prevent raw embedded JavaScript code in posts.

JavaScript
JavaScript:
JavaScript:
JavaSc:

JavaScript
JavaScript:
JavaScript:
JavaSc:

JabaTheHut
JabaTheHut:
JabaTheHut:
JabaHut:

JabaTheHut
JabaTheHut:
JabaTheHut:
JabaHut:

In general, the forum system makes a pass over your post text, interpreting tags and replacing strings to create the display version of your post. Sometimes transformations are applied where you don't expect it, and learning to avoid the quirks seems to be the only workaround. Luckily, they don't happen often, and they are almost always inconsequential.

One workaround in this case is to wrap
PHP:
 tags around your text even if it's not PHP code, and put up with the color coding that results.

[php]JavaScript
JavaScript:
JavaScript:
JavaSc:
 
Thanks for the insight. After some thought I figured it would be something like that since I'm a web developer. It's probably catching when it's looking for embedded JavaScript in links, such as,
HTML:
<a href="Javascript:DoFunction()">Link with JavaScript action</a>
The above has a capital J inside the href. It's a trivial thing. It just confused me when it happened in another thread. At first, when I created this thread, I didn't realize it only applied to the word JavaScript. Though, tried it in some post previews and noticed it then. So it's not a vBCode issue, it's tied to another security check script. I'll have to keep that in mind.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.