# Showing code blocks on knowledge base articles

**URL:** <https://community.hubspot.com/t/showing-code-blocks-on-knowledge-base-articles/124042>\
**Category:** CMS Development\
**Tags:** content\
**Created:** [January 15, 2025, 8:11pm UTC](https://community.hubspot.com/t/showing-code-blocks-on-knowledge-base-articles/124042 "2025-01-15T20:11:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aabendan](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@aabendan](https://community.hubspot.com/u/aabendan)\
**Post date:** [January 15, 2025, 8:11pm UTC](https://community.hubspot.com/t/showing-code-blocks-on-knowledge-base-articles/124042/1 "2025-01-15T20:11:33Z")

</div>

We have a knowledge base that features multiple articles with code blocks in them.

However, these code blocks are displayed as texts in gray boxes and nothing else. Can we render them so that our customers can easily copy and paste them into their own code?

I see that HubSpot’s own Developer site has a way to do this: [Fetching data for UI extensions - HubSpot docs](https://developers.hubspot.com/docs/guides/crm/public-apps/fetching-data)

 ![Screenshot 2025-01-15 at 2.10.25 PM.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/9/297f63136c8005de747d1b67173f3369d05a4bc7.jpeg)

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [January 16, 2025, 7:27pm UTC](https://community.hubspot.com/t/showing-code-blocks-on-knowledge-base-articles/124042/2 "2025-01-16T19:27:32Z")

</div>

Hey, @aabendan 👋 Great question. The answer is — yes, but partially. The Knowledge Base editor has a “code format” tool in the toolbar. But it’s not at the same level of robustness as what you see in the dev docs. Meaning you can add code samples, but it lacks the formatting and the nice “copy + paste” option for folks to use with your samples.

Example:

 ![CleanShot 2025-01-16 at 12.16.49 2@2x.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/f/2fdd0db2dd8fe47c04146f3a56981ac902f978b3.png)

My quick test

 ![CleanShot 2025-01-16 at 12.16.22@2x.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/3/3a359d527552873558e9f8240ae232cdfccf74cd.png)

It took a little tweaking to get the line breaks and indentation to look decent, but it’s doable.

If you have a moment, I think adding this to the **[Ideas](https://community.hubspot.com/t5/HubSpot-Ideas/idb-p/HubSpot_Ideas)** forum as a feature request would be helpful. I can definitely see the use case for having a more complete code block tool available for Knowledge Base pages.

I hope this is helpful.

Talk soon! — Jaycee
