How to do text highlight in markdown

quick-fix2 min read

Short article on how to do text highlighting in markdown using <mark> tags or double equal sign in our editor.

In this post, we will see how we can highlight text in markdown.

In markdown, there is no native way to highlight text, however, markdown allows us to use HTML if we need any feature that is not in markdown.

So to highlight text, we can use the <mark> tag in our markdown document.

<mark>Text highlight</mark> in markdown

The output will be

<mark>Text highlight</mark> in markdown

To change the color of the highlighted text, we can use some inline styles.

<mark style="background-color:pink">Text Highlighting</mark> in markdown

Output:

<mark style="background-color:pink">Text Highlighting</mark> in markdown

We can also use the <span> tag with inline styles to do a text highlighting in markdown.

<span style="background-color:yellow">Text Highlight</span> in markdown

Output:

<span style="background-color:yellow">Text Highlight</span> in markdown

Some markdown editors also support the double equal (==) sign to highlight text.

==highlight==

A list of editors that support double equal signs are:

  • Typora
  • Obsidian
  • Quilt
  • IA Writer

Note: In Typora editor, the user must enable double equals for highlighting first in Preferences > Markdown

Conclusion:

To highlight text in markdown we can use the <mark> HTML tag or the <span>tag with inline style.

Even though some text editors support double equal (==), it is better to use something which is supported by any editor.

So it's better to go with the <mark> tag for text highlighting.

Related Posts