Last updated 2023-11-05 14:47:22

How To Display HTML Syntax In Markdown

If you want to display and not render HTML syntax in your Markdown like this <‌p><‌/‌p‌> you have two options:

HTML Encoding

You can type out the HTML you would like to display in an online HTML encoder [↗] then copy and use the encoded HTML instead.

For example the encoded version of <‌‌h1><‌/‌h1‌> is ‌&‌l‌t‌;‌h‌‌1‌&‌g‌t‌;‌&‌l‌t‌;‌‌/‌h‌1‌‌&‌g‌t‌‌;.‌

Using the Zero Width Non-Joiner

This option leverages the invisible Zero Width Non-Joiner [→] character.

This character is invisible and cannot be seen. Let's look at how to use this.

Let's say you want to display the following HTML without rendering it <‌‌h1><‌/‌h1‌>.

Copy paste the Zero Width Non-Joiner character below then paste it where you see the paste_it_here pointer, Thus <‌‌paste_it_here h1><‌/paste_it_here h1>.


Use the second option with caution as this can be confusing to other editors of your Markdown document.

Here is another article you might like 😊 "Diary Of Insights: A Documentation Of My Discoveries"