markdown comments

Comments are detailed descriptions for readers to understand the line of markup code. These will be ignored by processors.

Markdown has no inbuilt support for comment syntax, but extended syntax vendors like GitHub and stackoverflow have provided the syntax, and can not be used with Markdown syntax.

HTML comments can be used in Markdown code, <!--- Wrap text ---> is the symbol that will be wrapped with comments text.

Some Markdown processors support two dashes of HTML Syntax <!-- Wrap text -->

here is the markdown comments syntax

This comment syntax will not work when parsing using pandoc markdown, comments shown in HTML.

_italic text_
<!---
comments syntax
--->
***  bold text**

and generated HTML code is

<p><em>italic text</em></p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<p>***  bold text**</p>

and output is

italic text:

  • bold text

As you can see comments are not visible to the user on the browser

How to write down comments Jekyll and GitHub markdown

Jekyll and GitHub Markdown supports the following comments

  • Inline comments
  • Block comments

Here is a comments’ syntax. Comment text started with {::comment} and ends with {:/comment}.

{::comment}
comment text
{:/comment}
  • Inline comments example

Comments are written in a single line along with content.

This is header tag content  {::comment}comment text{:/comment}
  • Block comments Example

It is used to write comment text in multiple lines.

{::comment}
comment text 1
comment text 2
ignored by parser
{:/comment}