---
sourceDocument: Brazil ServiceNow AI Platform Capabilities
sourceDocumentLink: https://www.servicenow.com/docs/r/servicenow-platform

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil ServiceNow AI Platform Capabilities

ft:clusterId :

    - platcap

bundleId :

    - platcap

workflow :

    - Platform


---

# Format a code snippet automatically in knowledge articles

# Format a code snippet automatically in knowledge articles {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read  
Add syntax highlighting to a code snippet in knowledge articles using the HTML
editor.

## Before you begin

Open the knowledge article in which you want to use the HTML editor.

Role required: knowledge

## About this task

You can also use the HTML editor when creating or editing a knowledge article using the Knowledge Management application in the ServiceNow AI Platform interface or in Agent Workspace. To create or edit a knowledge article in the ServiceNow AI Platform interface, see [Create a knowledge article](https://www.servicenow.com/docs/Ftcf6cL0UaKl0pA2wuz_nw "Knowledge contributors can create and edit knowledge articles within a knowledge base to share information across your organization.") or [Edit a knowledge article](https://www.servicenow.com/docs/TjDNRFqJbNdjEEJeYLc1cQ "Edit knowledge articles within a knowledge base to update information shared across your organization."). To create or edit a knowledge article in Agent Workspace, see [Create a knowledge article in Agent Workspace](https://www.servicenow.com/docs/MaZfwYdur_1UIzZIB2_irQ "Create a knowledge article in Agent Workspace to share information across your organization.") or [Edit a knowledge article in Agent Workspace](https://www.servicenow.com/docs/cPTnmDdtvATtdOty3Onnrg "Edit knowledge articles within a knowledge base in Agent Workspace to update information shared across your organization.").

## Procedure

1. In the Article body section, place the cursor where you want to insert the code snippet.
2. Click the insert/edit code sample icon on the HTML toolbar.
3. In the Insert/Edit code sample dialog box, select a markup or programming language from the Language list.
4. In the text box after the Language list, enter your code.  
   Alternatively, you can copy the code from an external source and paste it.
5. Click OK.
6. **Optional:** Edit the code by clicking the code snippet, and then clicking the insert/edit code sample icon .

