Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dev.to Syntax Highlighting

Great post!

Consider specifing the language in your markdown code blocks because Dev.to has syntax highlighting!

You can do this by adding the language after the first three backticks at the start of your code block:

// code block starts with '''js (but with backticks instead of ')
const fn = () => {
  const x = "hello"
  return 3 + x
}

vs

// code block starts with just ''' (but with backticks instead of ')
const fn = () => {
  const x = "hello"
  return 3 + x
}

Not sure that makes sense. The parser makes it difficult to explain. Here's a quick GitHub gist that will let you check out the raw text of this comment: Gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment