Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
mohannedshehri
1,101 PointsI need help with code in discussions.
Hello everyone, Whenever I want to start making discussions, I always face problems writing my code, I've seen the Makrdown Cheatsheet and did as it says but still my code won't show up properly, it shows up like normal texts, please help. Thanks.
12 Answers
Amirol Ahmad
1,819 PointsI do prefer you use this link as reference: http://daringfireball.net/projects/markdown/basics
Ex: <div>Hello World</div>
<div>Hello World</div>
Miguel de Luis Espinosa
41,279 PointsLet me see:
<blockquote>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
</blockquote>
Miguel de Luis Espinosa
41,279 PointsTry adding 4 spaces before the div
<div>Hello World</div>
Amirol Ahmad
1,819 Points<div>Hello World</div>
update: when reply the message, 4 spaces is not working
Miguel de Luis Espinosa
41,279 PointsThe pre tag doesn't work (it's ignored) so just add 4 spaces (or more) at the beginning of every line of code
<p>Hi</p>
mohannedshehri
1,101 Points<p>hello world</p>
mohannedshehri
1,101 PointsIt doesn't work.
Miguel de Luis Espinosa
41,279 Pointsweird, it does work for me
<p>yes it does</p>
Miguel de Luis Espinosa
41,279 Pointsthe spaces go at the beginning of your line of code; not before your code (just in case)
mohannedshehri
1,101 PointsYes i understood that but still it doesn't work,
<p>no it doesn't</p>
mohannedshehri
1,101 Points<p>wow it did!</p>
mohannedshehri
1,101 Points<p> i'm wondering if it still works </p>
Kenneth Love
Treehouse Guest TeacherI find it easiest to do anything that isn't a single word or two in a code block. To make a code block, you need a blank line between the last bit of text and the start of your block. Your block starts and stops with three backticks. A backtick looks like ` and, on US keyboards, is the unshifted version of the ~ and is usually up near the ESC key.
``` this is a code block ```
becomes
this is a code block
You can also syntax highlight the code by putting the language name after the first trio of backticks, like ```javascript.
If you want to use code in a sentence, just a single backtick ` on either side of the bit of code. `Like this` becomes Like this.
For more examples and more explanation, check out this other forum post from Dave.
mohannedshehri
1,101 Points<p>this is a code block</p>
Kenneth Love
Treehouse Guest TeacherLooks like you've got it figured out!
mohannedshehri
1,101 Points<p> thank you very much!</p>