How to do text highlight in markdown
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
Checkbox inside GitHub Markdown Table
Short article on how to create checkbox or tick and cross mark inside markdown table in Github using emoji.
How to convert markdown to PDF offline with Pandoc Converter
Find out how to convert or merge two or more markdown files into a pdf format in windows and MacOs using command line in Pandoc document converter.
Easy Way to add Emoji in markdown with VS Code
Find out how to add emoji in your markdown document in VS Code using markdown emoji or emojisense plugins.
How to open markdown link in new tab
Article on how to open a markdown link in a new tab in browser using target="_blank" in the ahref link.
