# Syntax highlighting indented code

**URL:** <https://talk.commonmark.org/t/syntax-highlighting-indented-code/1840>\
**Category:** Spec\
**Created:** [August 23, 2015, 3:26pm UTC](https://talk.commonmark.org/t/syntax-highlighting-indented-code/1840 "2015-08-23T15:26:43Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![rokejulianlockhart](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/rokejulianlockhart/32/3399_2.png) [@rokejulianlockhart](https://talk.commonmark.org/u/rokejulianlockhart)\
**Post date:** [December 3, 2024, 10:00pm UTC](https://talk.commonmark.org/t/syntax-highlighting-indented-code/1840/11 "2024-12-03T22:00:15Z")

</div>

> [@ioquatix](#):
>
> i.e. the code is indented and is easily distinguishable from the surrounding text.

@ioquatix, this seems somewhat like a case of the undermentioned:

> [@Inline HTML breaks when using indentation](https://talk.commonmark.org/t/inline-html-breaks-when-using-indentation/3317/6):
>
> This is my biggest gripe with Markdown as a whole. I find indentation to be such a significant part of readability that it seems insane that the specification retains the ability to create \<pre\>s using indentation, now that fenced code blocks exist, considering that it makes authoring readable HTML impossible. Consider the support provided to the undermentioned: I’ve asked at [Reddit](https://www.reddit.com/r/vscode/comments/1g8t0uj/can_markdowns_indented_code_blocks_be_disabled_in/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button) whether it’s possible to disable in VS Code, if anyone’s interested.

Fenced code blocks are an improvement in syntax highlighting capability, and I’m surprised that you solely ever encounter a need to indent when using code blocks. You should use fences.

However, note that Stack Exchange has implemented syntax for this:

[https://meta.stackexchange.com/revisions/360140/2#:~:text=Code%20fences%20are%20also%20now%20the%20preferred%20approach%20for%20creating%20code%20blocks%2C%20as%20the%20\<!--%20language:%20lang-none%20--\>%20approach%20was%20deprecated%20in%20the%202020%20switch%20to%20CommonMark:](https://meta.stackexchange.com/revisions/360140/2#:~:text=Code%20fences%20are%20also%20now%20the%20preferred%20approach%20for%20creating%20code%20blocks%2C%20as%20the%20%3C!%2D%2D%20language:%20lang%2Dnone%20%2D%2D%3E%20approach%20was%20deprecated%20in%20the%202020%20switch%20to%20CommonMark:)

---

_[View the full topic](https://talk.commonmark.org/t/syntax-highlighting-indented-code/1840)._
