Skip to content

Instantly share code, notes, and snippets.

@jonikarppinen
Last active April 21, 2024 23:44
Show Gist options
  • Star 62 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save jonikarppinen/47dc8c1d7ab7e911f4c9 to your computer and use it in GitHub Desktop.
Save jonikarppinen/47dc8c1d7ab7e911f4c9 to your computer and use it in GitHub Desktop.
How to comment out stuff in Markdown on GitHub?

Comments in GitHub flavour of Markdown

As answers to this Stack Overflow question reveal, using <!--- and ---> or <!-- and --> works (view source by clicking "Raw"):

Inline comments

How about commenting out <!--- just ---> a part of one line?

If you know of a way, please show me how by cloning this Gist, or commenting below!

Update 2019

As several commenters pointed out, for inline commenting <!-- a normal html comment --> now works.

You can't see this:

Btw, wow, I created this gist in 2014 and only now became aware of the discussion and that it's the top Google hit for markdown comments github. 👍

@GoelDarpan
Copy link

GoelDarpan commented Oct 9, 2023

Need help - dotnet/docfx#9285

@sienna-jeong
Copy link

Is there a keyboard shortcut to do it?

@wxnnvs
Copy link

wxnnvs commented Feb 27, 2024

@a-pav
Copy link

a-pav commented Apr 18, 2024

I just used this trick in a comment where I thought some details I've wrote might be unnecessary but at the same time I didn't want lose those details, and, I might actually need those in a follow up comment. So I commented them out, now I have access to those by pressing Edit mwahahaha :))

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