markdown comments

Comments are a useful detailed description 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 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 write in a single line along with content.

This is header tag content  {::comment}comment text{:/comment}

Block comments Example

It uses to write comment text in multiple lines.

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