Welcome to WebmasterWorld Guest from 3.209.80.87

Forum Moderators: open

Documentation for the [code] tag?

     
4:02 pm on Jul 19, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Nov 13, 2016
posts:1194
votes: 285


Hi,

I might fall in the dumb people section : [webmasterworld.com...] , but I can't find the documentation about how to use the [ code ] tag. I posted a code at another topic, and I had a hard time indenting it, using spaces (or tabs), and each time I edited my post, the indentation was getting messed up.

Also, it looks like it's not possible to use a code which would include a PHP null coalescing operator, which are two question marks, each time the second question mark is removed ?!

So I am certainly missing something.

Thank you !
5:08 pm on July 19, 2019 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:4508
votes: 348


For something that ends up looking like
something something.php ??
you need to use some imagination. It goes like this:
something something.php ?[b ][/b ]?
(spacing added to the [b ] brackets to break their function).

Your hint was here: [webmasterworld.com...]

Elegant <p> or tab indentations are a different story, I can only tell you how to break them. (hit 'Submit' button)

5:20 pm on July 19, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Nov 13, 2016
posts:1194
votes: 285


Silly me , it didn't come to my mind, to use formatting tags within the [ code ] one . Thank you !
5:22 pm on July 19, 2019 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15869
votes: 869


The Forums software makes assumptions about what language a [ code ] snippet is in (even if it is not actually code at all :)) and highlights syntax accordingly. Sometimes it works; sometimes it doesn’t.

If all else fails, you can get indentation to work by manually replacing every other space with a nonbreaking space:
line1
line2 (spaces are collapsed)
line3 (more spaces, still collapsed)
vs.
line1
  line2 (nbspaces, not collapsed)
    line3 (more nbspaces)

As compared to [ code ] markup, which apparently treats all spaces as halfwidth (and eats half of them when you edit):
line1
line2 (spaces not collapsed)
line3 (more spaces)
vs.
line1
  line2 (nbpaces)
    line3 (more nbspaces)

Watch out for old posts from before the Forums software was last updated (2015 or so? I forget), because [ code ] markup used to be inline and now it's block-level, leading to unintended results.
5:38 pm on July 19, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Nov 13, 2016
posts:1194
votes: 285


Okay!