Last Updated on August 2, 2017 by Rakesh Gupta
After Spring’14 release you can now add Code samples to posts when the rich text editor is enabled in Chatter Answers and Ideas, and code will display in proper format.
Configure this feature for your organization
To configure it for ideas follow the blow steps
1) Click on Name | Setup | App Setup | Customize | Ideas | Settings
2) Click on Edit
3) Select “Enable Text-Formatting, Images and Links” checkbox
4) Click on Save
Note :- Once you enabled this setting, you can’t disable it. For Chatter Answers, select Enable Rich Text Editor, You can take help from below image.
Now it’s time to test this feature
To test this feature follow the below steps
1) Navigate to Idea tab, click on any idea it will drill down you to idea detail page or create a New Idea
2) Here you can past sample code ( I will show you first old output then you will come to know that the difference between both )
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World"); } }
Paste the sample code and click on Post.
3) Now we will try with new feature, first copy a code sample from any text editor and click on button to open the Add a code sample text box. Similar to below image
4) Click on OK, then click on Post. The code sample appears in the body of the post with its formatting intact.
5) Below image shows the difference between old and new method