Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add inline comments in Github Flavored Markdown?

I'm trying to create a gist with an inline comment. I read a solution here which works for putting a comment on it's own line (as shown in the image); however, it doesn't appear to work for inline comments. Is there any way to get inline comments in github flavored markdown? enter image description here

- [x] some item
- [ ] another item with meta info [//]: # (attempt at meta info as inline comment)


[//]: # (This may be the most platform independent comment)
[//]: # (https://stackoverflow.com/questions/4823468/comments-in-markdown)
like image 711
mbigras Avatar asked May 21 '16 15:05

mbigras


People also ask

How do you comment a line in Markdown?

Adding HTML Comments in Markdown Unlike a "normal" HTML comment which opens with <! -- (two dashes), an HTML comment in Markdown opens with <! --- (three dashes). Some Markdown parsers support two-dash HTML comments, but the three-dash version is more universally compatible.

How do you add a note in Markdown?

Turn on Markdown Formatting for notes. For this, go to Tools > Options > Appearance and check "Use Markdown format in notes".

How do I add comments to github?

On the pull request, click Files changed. Hover over the line of code where you'd like to add a comment, and click the blue comment icon. To add a comment on multiple lines, click and drag to select the range of lines, then click the blue comment icon. When you're done, click Add single comment.

How do I add a horizontal line in github?

To create a horizontal line, use three or more asterisks ( *** ), hyphens ( --- ), or underscores ( ___ ): Some text! ---Next chapter or something!


2 Answers

You can also just do this

<!--- Comments are Fun --->

Remember, markdown is just an easier way to write HTML content. (note the triple dash)

  • some item
  • Something with an inline comment
like image 170
Ronak Shah Avatar answered Oct 23 '22 10:10

Ronak Shah


looking more closely at this solution a possible workaround for inline comments:

- [x] some item
- [ ] another item with meta info [//]: # (attempt at meta info as inline comment)
- [ ] using @ig0774's recomendation [](with an inline comment hidden inside an empty link)

[//]: # (This may be the most platform independent comment)
[//]: # (https://stackoverflow.com/questions/4823468/comments-in-markdown)
[](and another comment down here too using the empty link method)

enter image description here

like image 27
mbigras Avatar answered Oct 23 '22 08:10

mbigras