Forum tip: add spoilers when showing code samples

I’m pretty new to this forum platform and I’m still figuring out it’s features.

I just stumbled across a trick we can use to put code (or anything) in a spoiler block.

The markdown for it is this [.details="Some Label"]Text you want to hide[/details] (remove the ‘.’ from the first details tag – I only added that to write it without it rendering the block!)

So [.details=Spoiler]BOOOO![/details]

becomes:

[details=Spoiler][/details]

@P1xt

3 Likes
Trying again

Did this work?

Edit: Yes :slight_smile:

function Person(name,age) {
this.name = name;
this.age = age;
this.species = “Homo Sapiens”;
}

var sally = new Person(“Sally Bowles” , 39);
var holden = new Person(“Holden Caulfield” , 16);
console.log("sally’s species is " + sally.species + " and she is " + sally.age );
console.log("holden’s species is " + holden.species + " and he is " + holden.age );
Can anyu one explain how the function is playing role here in depth…

let me see…

Spoiler

“What does this button do?”

Spoiler

<!-- and what about this? -->
<html></html>
var mycode = "some other thing";

Cool trick! I just post my 1st solution in spoilers :smiley:

[details=“Test”]can you see me ??? :stuck_out_tongue:
Some markdown here!!!
i am bold[/details]

Thanks Jackson, but you can’t put markdown inside this tag ?

Edit: ah yes, you must add a newline (or a space ? didn’t test) between the tag and the content :

Test

can you see me ??? :stuck_out_tongue:
Some markdown here!!!
i am bold

2 Likes