The same markdown text shown differently on a laptop and a phone

Why Markdown previews can differ between platforms

Markdown is a family of related parsers and extensions, so a preview must be interpreted as a helpful approximation unless it uses the target platform’s renderer.

Why the same Markdown looks different in two places

Markdown was designed as a plain-text shorthand for HTML, but it was never a single fixed standard with one official renderer. The original Markdown syntax described a small set of constructs: headings, emphasis, links, lists, code, and blockquotes. Everything beyond that — tables, footnotes, task lists, strikethrough, syntax highlighting, math, embedded media — came later as extensions, and different platforms adopted different subsets. As a result, the same source file can produce different HTML on GitHub, in a CMS, in a notes app, and in a static-site generator, even when none of the renderers is buggy.

The most important consequence is practical: a preview is only a promise about the renderer that produced it. A preview in your editor tells you what that editor’s parser does. It does not guarantee that your publishing platform, your documentation host, or a reader’s email client will do the same thing. Treat any preview from a different renderer as an approximation and confirm the result in the destination.

CommonMark, GitHub Flavored Markdown, and other dialects

Confirm which dialect your destination uses. CommonMark, GitHub Flavored Markdown, and CMS-specific extensions do not have identical feature sets. CommonMark is a strongly specified dialect that pins down many edge cases, such as how nested emphasis and list indentation are handled. GitHub Flavored Markdown (GFM) builds on CommonMark and adds tables, task lists, strikethrough, autolinking, and syntax highlighting. Many wikis, CMS platforms, and notes apps add their own extensions, such as callouts, transclusion, or custom shortcodes.

Feature CommonMark GitHub Flavored Markdown Many CMS / notes apps
Tables Not in core spec Yes Often, but syntax varies
Task lists No Yes (- [ ]) Sometimes
Strikethrough No Yes (~~text~~) Sometimes
Footnotes No No (GitHub does not render them) Often via extension
Math No No Often via extension

A table that renders beautifully on GitHub may appear as raw pipe characters on a platform without table support. A footnote that works in one static-site generator may be ignored in another. When you write for more than one destination, stick to the intersection of features that all of them support, and treat anything outside that intersection as decorative.

A concrete example: one source, three outputs

Take this short source:

## Release notes

- [x] Ship search fix
- [ ] Update screenshots

| Plan | Price |
| --- | --- |
| Basic | $0 |

~~Old price: $49~~ New price: $39

On GitHub, the task list shows checkboxes, the table renders as a table, and the strikethrough crosses out the old price. In a strict CommonMark renderer without extensions, the task-list markers appear as literal text [x] and [ ], the table appears as raw pipes, and the double tildes may appear literally or be treated as plain punctuation. In a CMS that supports tables but not task lists, you get a mixed result: a real table beside literal checkbox text. None of these renderers is wrong in isolation; they simply implement different feature sets.

Raw HTML, embedded content, and sanitization

Treat raw HTML and embedded content carefully. A preview that escapes HTML is safer for pasted text but will not show every feature supported by a publishing platform. Some renderers pass raw HTML through untouched, so an embedded <div>, iframe, or script-adjacent markup can appear in the output. Others escape it to visible text, and still others strip it entirely. Sanitization also varies: one platform may allow images with links, another may strip attributes such as class or style.

This matters most when you paste Markdown from another source. Content copied from a web page, a chat app, or an AI tool may contain raw HTML, tracking parameters, or inline styles that one preview shows and another silently drops. If a layout element disappears after publishing, check whether the destination sanitizes raw HTML rather than assuming your source was malformed.

Line breaks, lists, and other quiet differences

Several small rules differ between renderers and cause confusion even in basic documents:

  • Single line breaks: In classic Markdown, a single newline inside a paragraph is treated as a space. Some platforms and editors use a hard-break rule where a single newline creates a <br>. A paragraph that looks compact in one preview can look spaced out in another.
  • List indentation: Nested lists need consistent indentation, but the exact number of spaces required varies. Two spaces may nest correctly in one renderer and create a sibling item in another. Use four spaces for nesting when portability matters.
  • Emphasis with underscores: Underscores inside words, such as my_variable_name, are treated as literal text by GFM but can be interpreted as emphasis markers by some older parsers, producing unexpected italics.
  • Autolinking: GFM automatically links bare URLs and email addresses. Strict CommonMark does not autolink plain URLs in all cases, so a bare URL may stay as text in one destination and become a link in another.
  • Heading IDs: Automatic anchor IDs for headings differ by renderer. A table of contents that links to #release-notes on one platform may need #release_notes or another form elsewhere.

Images, links, and relative paths

Relative image paths are another frequent source of mismatch. A preview in your editor resolves ![Diagram](./images/diagram.png) relative to the file on disk. After publishing, the same relative path resolves against the published URL, which may be a different directory. A diagram that shows locally can break on the live site even though the Markdown is identical. Absolute URLs avoid this, but they make the source harder to move between environments. When images matter, verify them on the live page, not only in the editor preview.

Link titles, reference-style links, and shortcut links also vary in support. Reference definitions placed at the bottom of a document work in most renderers, but some minimal parsers only support inline links. If a link renders as literal bracket text, the renderer probably does not support the reference form you used.

A portable Markdown workflow

  1. Identify the destination renderer and its dialect before you write. Check its documentation for tables, task lists, footnotes, math, and raw HTML.
  2. Write to the intersection of features supported by every destination you will publish to. Avoid exotic extensions in shared documents.
  3. Use four-space indentation for nested lists, blank lines around headings, lists, and code blocks, and inline links for the most portable links.
  4. Use the final destination for the last visual check, especially when headings, links, code, tables, or accessibility semantics are important.
  5. Check images, anchors, and tables on the live page. Do not rely on the editor preview for those elements.
  6. If you must use an extension, note it at the top of the document so the next editor knows the document depends on that renderer.

Limitations of preview tools

A preview tool can show you one renderer’s interpretation, but it cannot promise that another renderer agrees. It cannot know your CMS sanitization rules, your theme’s CSS, or whether your host rewrites relative URLs. It also cannot check accessibility: a table without a header row, an image without alt text, or a heading hierarchy that skips levels can look fine in a preview while remaining difficult to use with a screen reader. Treat the preview as a drafting aid, and treat the published page as the source of truth.

FAQ

Q: Why does my table show as plain text with pipes?

A: Your destination renderer does not support the table extension, or it requires a different table syntax. Check the destination’s Markdown documentation. If tables are unsupported, present the data as a list or an HTML table where raw HTML is allowed.

Q: Why do checkboxes show as [ ] instead of real checkboxes?

A: Task lists are a GFM extension. A renderer without that extension prints the markers as text. Either publish only to renderers that support task lists, or replace the markers with a plain list and state completion in words.

Q: Why does a heading link work in one place but not another?

A: Heading anchor IDs are generated differently by each renderer. Spaces may become hyphens, underscores, or be removed, and punctuation handling varies. Verify the actual anchor on the published page instead of copying an anchor from a different preview.

Q: Is CommonMark the same as Markdown?

A: No. CommonMark is one well-specified dialect of Markdown. GFM extends CommonMark, and many platforms add further extensions. Saying a document is “Markdown” does not identify which dialect or extensions it needs.

Use the related tool carefully

This guide is paired with a browser-only utility. The tool is a practical aid for small examples and inspection; it is not a substitute for application testing, a formal data pipeline, or professional review where the decision has higher consequences.

Open the related Markdown Previewer

Sources