Skip to content

Instantly share code, notes, and snippets.

@imjoshellis
Last active November 15, 2020 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imjoshellis/236394d482d8e5b33f7b4507dbaae516 to your computer and use it in GitHub Desktop.
Save imjoshellis/236394d482d8e5b33f7b4507dbaae516 to your computer and use it in GitHub Desktop.
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