Forum Moderators: open

Message Too Old, No Replies

Documentation for the [code] tag?

         

Dimitri

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

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



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 !

not2easy

5:08 pm on Jul 19, 2019 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



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)

Dimitri

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

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



Silly me , it didn't come to my mind, to use formatting tags within the [ code ] one . Thank you !

lucy24

5:22 pm on Jul 19, 2019 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



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.

Dimitri

5:38 pm on Jul 19, 2019 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



Okay!