Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you escape comments in markdown?

Tags:

markdown

If I write <date> (without the ` back ticks) in markdown it disappears as markdown thinks I'm trying to write a comment. How can I make <date> appear in plain text, in markdown, without having to resort to back ticks? I tried escaping the < and > but that didn't help anything.

like image 335
Display name Avatar asked Oct 31 '25 10:10

Display name


1 Answers

The Syntax Rules mention this specifically:

In HTML, there are two characters that demand special treatment: < and &. Left angle brackets are used to start tags; ampersands are used to denote HTML entities. If you want to use them as literal characters, you must escape them as entities, e.g. &lt;, and &amp;.

Therefore, you can do this:

&lt;date&gt;

which renders as

<date>

As an aside, I remember the names of these entities by the names of the symbols. The letters lt and gt are acronyms for "less than" and "greater than" respectively.

like image 98
Waylan Avatar answered Nov 02 '25 23:11

Waylan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!