How to add code comments in markdown that DO NOT render into html? [duplicate]

StackOverflow https://stackoverflow.com/questions/23422898

  •  14-07-2023
  •  | 
  •  

Вопрос

I want to include comments (aka code comments) to my markdown.

Something like this

// I want this line to not render in the html

I've tried the different approaches that javascript uses but they all render as normal text and show in the final markup.

What's the nicest way I could achieve comment like functionality?

Это было полезно?

Решение

< !-- *comment* --/> should work

Explanation: Because markdown partially supports HTML.

Its syntax is very small, corresponding only to a very small subset of HTML tags1.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top