# Issue with Code Block Formatting in Discourse – Red Text and Unintended Highlighting

**URL:** <https://meta.discourse.org/t/issue-with-code-block-formatting-in-discourse-red-text-and-unintended-highlighting/321315>\
**Category:** Product Support\
**Tags:** code\
**Created:** [August 12, 2024, 6:09pm UTC](https://meta.discourse.org/t/issue-with-code-block-formatting-in-discourse-red-text-and-unintended-highlighting/321315 "2024-08-12T18:09:22Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![bryce](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bryce/32/377822_2.png) [@bryce](https://meta.discourse.org/u/bryce)\
**Post date:** [August 12, 2024, 10:53pm UTC](https://meta.discourse.org/t/issue-with-code-block-formatting-in-discourse-red-text-and-unintended-highlighting/321315/22 "2024-08-12T22:53:26Z")

</div>

Hi Alex,  
I think @Moin has the right idea–I’m seeing some styling applied to the code blocks that looks like it’s probably coming from **Custom CSS/HTML** in the theme.

 ![This image shows a computer screen displaying a code editor with a Python script that includes various imports and function definitions. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/5/5/5/555d09462f6f6609457d1c749582ff2d9bebc843.png)

I think this line (`font-family: Consolas;`) could be safely removed since it’s overriding these existing styles which use the same font but also specify fallback options:

```css
code, pre {
    font-family: var(--d-font-family--monospace);
}

:root {
    --d-font-family--monospace: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace;
}

```

Maybe your computer isn’t able to display Consolas and is just falling back to the default (non-monospace) font. You can check here to see if that CSS is present:

 ![](https://global.discourse-cdn.com/meta/original/4X/1/a/7/1a705db313b88d495c02f71b7b0837f84844aa22.png)

---

_[View the full topic](https://meta.discourse.org/t/issue-with-code-block-formatting-in-discourse-red-text-and-unintended-highlighting/321315)._
