Backticks for code formatting
How are backticks used for code formatting? Whatever way I try, it does not render properly. Do I put the backticks at the beginning and end of each line of code? If I just use a backtick at the beginning then another at the end, some lines appear and others do not.
Discussions are closed to public comments.
If you need help with Lighthouse please
start a new discussion.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac
1 Posted by Nicole on 22 Feb, 2011 09:09 PM
Jesse -
<code>spans are delimited by backticks. If you have code blocks I suggest using the@@@method for code formatting. Placed at the beginning of your code and and the end on it's own line should work.If not, can you show us a sample of your code so we can help you troubleshoot it? Is this happening in a knowledge base article?
Thanks,
Nicole
2 Posted by Amanda Harasty on 25 Feb, 2011 10:47 PM
Jesse,
Just checking back in to see if you need any additional clarification on this issue.
3 Posted by Jesse on 01 Mar, 2011 03:54 PM
Hi Amanda and Nicole,
I get inconsistent results when I try variations of the backticks. For
example, the following code block:
`
<PCNRemoteAccessResponse>
<AgencyProgress agency_id=3D"654321">
<course name=3D"Customer Service">
<completed>0</completed>
<in_progress>1</in_progress>
<not_attempted>1</not_attempted>
</course>
<course name=3D"Emotional Intelligence">
<completed>0</completed>
<in_progress>1</in_progress>
<not_attempted>1</not_attempted>
</course>
</AgencyProgress>
<!-- ...etc for each agency -->
<status>success</status>
</PCNRemoteAccessResponse>
`
This results in the first set of lines (through "<!-...etc for each
agency-->") formatted as code, then the tags on the last two lines
stripped. I've tried variations of placing the backticks at different
points and adding lines before and after, but I still can't get this
entire block formatted as code. I have a bunch of XML I need to
include in tickets, so formatting this cleanly is important for our
team.
Thanks!
Jesse Nahan
4 Posted by Jesse on 01 Mar, 2011 03:57 PM
Hi Amanda and Nicole,
I get inconsistent results when I try variations of the backticks. For
example, the following code block:
`
<PCNRemoteAccessResponse>
<AgencyProgress agency_id=3D"654321">
<course name=3D"Customer Service">
<completed>0</completed>
<in_progress>1</in_progress>
<not_attempted>1</not_attempted>
</course>
<course name=3D"Emotional Intelligence">
<completed>0</completed>
<in_progress>1</in_progress>
<not_attempted>1</not_attempted>
</course>
</AgencyProgress>
<!-- ...etc for each agency -->
<status>success</status>
</PCNRemoteAccessResponse>
`
This results in the first set of lines (through "<!-...etc for each
agency-->") formatted as code, then the tags on the last two lines
stripped. I've tried variations of placing the backticks at different
points and adding lines before and after, but I still can't get this
entire block formatted as code. I have a bunch of XML I need to
include in tickets, so formatting this cleanly is important for our
team.
Thanks!
Jesse Nahan
5 Posted by Nicole on 01 Mar, 2011 08:54 PM
Jesse -
If you place
@@@on the line before and after your code, does that strip out the tags on the last two lines?Let us know.
Thanks,
Nicole
6 Posted by Jesse on 01 Mar, 2011 09:28 PM
Hi Nicole,
Placing @@@ on the line before and after my code snippets works great. Thanks!
Jesse
7 Posted by Jesse on 01 Mar, 2011 09:28 PM
Hi Nicole,
Placing @@@ on the line before and after my code snippets works great. Thanks!
Jesse
Nicole closed this discussion on 01 Mar, 2011 09:42 PM.