Markdown Highlight

When taking reading notes or writing code review comments, you often need to "mark" certain text — like using a highlighter pen on paper. HTML has a built-in <mark> tag for this, but in Markdown, the highlight syntax is an extension — not every platform supports it. Let's cover how to use it, where it works, and what to do when it doesn't.

What is Markdown Highlight

Highlight (also called mark) adds a background color (usually yellow) behind text, making it look like it was swiped with a highlighter pen. Here's what it looks like:

This sentence has ==important content== highlighted

When rendered, "important content" shows up with a yellow background. In HTML, this corresponds to the <mark> element, which represents "text highlighted for relevance" .

One thing to be clear about: highlighting is not part of standard Markdown syntax. Neither the original Markdown syntax documentation nor the CommonMark spec defines a highlight syntax — it's something individual implementations added on their own . That's why you'll find some platforms support it and others don't. We'll get into the details below.

Double Equals Syntax ==highlight==

Basic Usage

The most common highlight syntax wraps text in double equals signs:

This feature was fixed in ==v2.0==

When rendered, "v2.0" appears with a yellow highlight background. The syntax is straightforward — just like Markdown bold uses ** and Markdown italic uses *, highlighting uses == .

Highlight with Other Formatting

Highlighted text can include other Markdown syntax at the same time:

This API is ==**deprecated**==, please use the new version

Here "deprecated" is both highlighted and bold. It renders with both a yellow background and bold text.

You can also nest links inside highlights:

See ==[official docs](https://example.com)== for details

Multiple Highlights

A document can have multiple highlighted sections:

==Point 1==: System architecture needs optimization
==Point 2==: Database query efficiency is low
==Point 3==: Cache strategy needs adjustment

Multi-line Highlights

Each line gets its own == wrapper:

==2024 Q1: Complete architecture refactor==
==2024 Q2: Launch new caching system==
==2024 Q3: Performance targets met==

HTML Mark Tag: The Universal Fallback

To be honest, while the ==highlight== syntax is convenient, compatibility is a real problem. If your target platform doesn't support double equals, the most reliable fallback is using the HTML <mark> tag directly:

This feature was fixed in <mark>v2.0</mark>

Since virtually all Markdown parsers preserve HTML tags, this approach renders correctly on almost every platform . The downside is that it's more verbose than ==, but at least you're guaranteed it works.

I learned this the hard way. I had written a bunch of reading notes in Obsidian using ==highlight== — beautifully annotated and color-coded. Later I tried pasting a section into a GitHub issue, pushed it up, and... the == marks showed up as plain text, completely unrendered. Since then I've adopted a simple rule: content that needs to work across platforms gets <mark> tags, and I only use == syntax in editors like Obsidian and Typora where I know it's supported.

The Semantics of the Mark Tag

<mark> isn't just visual — it carries clear semantics meaning "text marked for relevance in the current context." Typical use cases include:

  • Highlighting matching keywords in search results
  • Emphasizing parts of a quote that the original author didn't stress
  • Marking progress in a to-do list

If you just need visual emphasis, Markdown bold might be more appropriate. <mark> is best for "this text has special relevance in the current context" situations .

Custom Highlight Colors

The default yellow background doesn't always fit your needs. For instance, on dark themes, yellow highlights can be glaring. Or you might want different colors for different types of highlights.

Changing Colors with CSS

The <mark> tag supports inline styles:

<mark style="background-color: #ff6b6b;">Red highlight</mark>
<mark style="background-color: #51cf66;">Green highlight</mark>
<mark style="background-color: #339af0;">Blue highlight</mark>

This works on most Markdown platforms that support HTML. Keep in mind, though, that some platforms (like GitHub) strip inline styles, so custom colors won't work there.

Customizing in Typora

Typora lets you change highlight colors through CSS theme files. Add this to your theme's CSS:

mark {
  background-color: #fff3bf;
  padding: 0.1em 0.2em;
  border-radius: 2px;
}

I once changed the highlight color in Typora to light blue because the default yellow had almost no contrast against the dark theme I was using — you could barely tell the text was highlighted. After the CSS tweak, it looked great both in the editor and in exported PDFs.

Platform Compatibility Comparison

This is what most people want to know. Here's how major platforms handle the two highlight approaches:

Platform==highlight==HTML <mark>Notes
ObsidianNative double-equals support
TyporaNative support, customizable colors
PandocRequires highlight extension
GitLabNative GLFM support
Jupyter NotebookSupported via extension
GitHubNo == support, use <mark>
VS Code PreviewNo == support
CommonMarkNot in the standard spec
Stack OverflowNeither method works
NotionUses its own highlight syntax

Key takeaways:

  • GitHub is the most common platform that doesn't support == — for READMEs, issues, and PR descriptions, you'll need <mark>
  • Obsidian and Typora are the most friendly — both double-equals and HTML tags work
  • GitLab supports it natively, which gives it an edge over GitHub
  • Stack Overflow doesn't support highlighting at all — even <mark> gets stripped

When to Use Highlight vs Bold vs Other Formatting

Highlighting, bold, Markdown underline, and Markdown strikethrough all draw attention, but they carry different meanings:

FormatSyntaxSemanticsBest For
Highlight==text== / <mark>Relevant in current contextReading notes, code review comments
Bold**text**Inherent importanceHeadings, key terms, warnings
Strikethrough~~text~~No longer accurate / completedDeprecated content, finished tasks
Underline<u>text</u>Proper nouns, spelling hintsTerm annotations

The simple rule: use highlighting when you want readers to notice "this matters in the current context," and use bold when "this word is important on its own."

Practical Use Cases

Reading Notes

The author argues that ==technical debt is like financial debt== — short-term borrowing can accelerate development, but if you don't pay it back, the interest compounds and eventually drags the entire project down.

Highlighting key passages from original text in reading notes, paired with your own annotations, makes review sessions much more efficient.

Meeting Notes

## Project Status Update

- Frontend refactor is 80% done, expected to go live in ==staging this Friday==
- Backend API changes need ==alignment with the mobile team==
- Database migration plan ==approved by DBA==

Highlight deadlines and key decisions in meeting notes so you can spot the important bits at a glance.

Changelog / Release Notes

## v3.2.0 Release Notes

- ==Added:== Dark theme toggle support
- ==Fixed:== Intermittent 500 errors on file upload
- ==Breaking:== Removed `legacyMode` config option

Highlighting change types helps readers quickly find the updates they care about.

FAQ

How do I highlight text on GitHub?

GitHub doesn't support the ==highlight== syntax. Use HTML instead:

This is <mark>highlighted text</mark>

If GitHub strips <mark> too (rare but possible), you can fall back to bold **text** or inline code `text` for visual distinction.

Is highlight part of the Markdown standard?

No. Highlighting is an extension — it's not in the CommonMark spec or the original Markdown syntax documentation . Individual parsers (Obsidian, Typora, Pandoc, etc.) implemented it as an add-on feature.

Is there a difference between ==highlight== and ?

The rendered result is the same — ==text== gets converted to <mark>text</mark> by supporting parsers. The difference is just syntactic sugar: == is quicker to type but has worse compatibility, while <mark> is more verbose but works almost everywhere.

Can I use Markdown highlighting in Notion?

Notion has its own highlight feature (the /highlight command or selecting text and setting a background color), but it doesn't support Markdown's ==highlight== syntax or the <mark> tag. You'll need to use Notion's built-in tools.


References

: Markdown Guide — Extended Syntax: Stack Overflow — Text highlight in markdown: MDN Web Docs — HTML Mark Element: Obsidian Help — Formatting and syntax: GitLab Docs — GitLab Flavored Markdown (GLFM)