Click here to Skip to main content
Click here to Skip to main content

Tagged as

Formatting code in Tips and Tricks

, 8 Apr 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
Syntax Coloring For Tip/Trick
Code in Tip/Trick Posts should wrapped with <pre> </pre> tags to ensure formatting and colouring are correct.

 

For example:

 

<pre lang = "vb">
' Example  
Dim test As String
</pre>
will produce:

' Example
Dim test As String
 

To specify the programming language, use lang="xxx" as follows:

 

<pre lang = "C++"> for Native C++ Formatting
<pre lang = "mc++"> for C++/CLI Formatting
<pre lang = "aspnet"> for ASP.NET Formatting
<pre lang = "cs"> forC# Formatting
<pre lang = "css"> for CSS Formatting
<pre lang = "F#"> for F# Formatting
<pre lang = "html"> for HTML Formatting
<pre lang = "Java"> for Java Formatting
<pre lang = "jscript"> for JavaScript Formatting
<pre lang = "asm"> for MASM/ASM Formatting
<pre lang = "msil"> for MSIL Formatting
<pre lang = "midl"> for MIDL Formatting
<pre lang = "php"> for PHP Formatting
<pre lang = "sql"> for SQL Formatting
<pre lang = "vbscript"> for VBScript Formatting
<pre lang = "xml"> for XML Formatting
If you want to enter text like <pre lang = "xml">,

  1. Check the allow HTML radio button in the Tip/Trick editor "When Pasting" option list. Use the article editor to enter text. Copy its HTML and paste here.

  2. Learn the special text for symbols like <(&-lt-; Remove the - for the symbol)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Anshul R
Student
India India
No Biography provided

Comments and Discussions

 
GeneralFDG PinprofessionalPawan Pandey (P.P)31-Oct-13 7:38 
QuestionThis is not working Pinmembermuhtarqong11-Feb-13 8:28 
GeneralReason for my vote 5 PinmemberD-Kishore3-Sep-12 19:56 
GeneralReason for my vote of 5 very helpful while we post some tips... Pinmembernikhi _singh15-Feb-12 0:03 
Generalwhen & where can i edit a question submitted by someone else... Pinmemberanushripatil10-Jan-12 18:20 
GeneralReason for my vote of 5 Thx PinmemberPranit Kothari3-Jan-12 15:22 
GeneralReason for my vote of 5 usefull one PinmemberRupeshKumar26-Sep-11 5:23 
GeneralReason for my vote of 1 feeeeeeee Pinmemberaaditya bhargava bansi17-Jul-11 3:00 
GeneralReason for my vote of 5 Really useful!! PinmemberWong Shao Voon10-Feb-11 22:50 
GeneralReason for my vote of 5 Good one PinmemberEswa11-Dec-10 4:05 
GeneralTwo things: this information is already included in the arti... PinmemberknockNrod14-Sep-10 6:18 
GeneralOne problem... PinmemberSteve Wellens4-Sep-10 13:33 
GeneralRe: One problem... PinmemberSteve Wellens28-Nov-10 3:47 
GeneralRe: One problem... Pinmemberpranav9529-Nov-10 0:26 
SuggestionRe: One problem... PinmemberShahan Ayyub24-Mar-13 5:03 
I faced the same issue and since then i took a backup of edited text in MSWord before moving forward (and paste it when come back and formatting get lost). It saved me to make the same changes again.
 
See if it helps!

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.141022.2 | Last Updated 9 Apr 2013
Article Copyright 2010 by Anshul R
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid