Every GitHub user knows the small embarrassment of pushing a README, opening it, and finding a table collapsed into a paragraph of pipes, or a code block that swallowed the rest of the page because one fence was missing. GitHub does have its own preview when you write an issue or pull request, but for files you commit, the first real look is often the published page, in front of everyone. Drafting the text somewhere with a live preview first removes that gamble. This guide shows the workflow using the Markdown Editor on Ovatly: write on the left, watch it render on the right, fix what breaks, then paste the clean source into GitHub.
Contents
- Quick answer
- Why Markdown breaks when pasted blind
- Previewing before you paste, step by step
- Worked example: a README section, checked before pasting
- The GFM difference, stated honestly
- Limitations
- Common mistakes
- FAQs
- Conclusion
Quick answer
Write or paste your Markdown into the Markdown Editor, watch the live preview on the right, and check the parts that break most often: headings, lists, links, fenced code blocks and pipe tables. Fix everything while the rendering is in front of you, then copy the source text (not the preview) into GitHub. One honest caveat: GitHub renders GitHub Flavored Markdown, its own dialect, so the editor's preview is a close check of standard Markdown, not a pixel-perfect promise of the GitHub page.
Why Markdown breaks when pasted blind
Markdown fails quietly. A missing blank line before a list can glue it onto the paragraph above. A table row with one pipe too few renders as ordinary text with no error message. An unclosed code fence turns every following heading, list and paragraph into code until the end of the document. None of these produce a warning in a plain text editor, because in plain text they all look fine.
The failures share one cause: you cannot see the rendered result while you write. A live preview closes that gap. The moment a table stops being a table, you see it, and the fix is usually a single character.
GitHub adds a second reason to check first. Files like READMEs are committed, not posted through a form, so there is no built-in preview step unless you deliberately create one. The editor is that step.
Previewing before you paste, step by step
- Open the Markdown Editor. The left pane is for writing; the right pane is the live preview.
- Write or paste your Markdown in the left pane. The preview updates as you type.
- Check the structure first: do the headings land at the levels you intended, and do lists break out of paragraphs cleanly? Add a blank line before any list or heading that has glued itself to the text above.
- Check code next. Every fenced block should open and close with its own triple backtick line, and inline code should sit inside single backticks. A block that runs to the end of the preview means a missing closing fence.
- Check tables. Each pipe table needs a header row, a separator row of dashes, and the same number of pipes in every row. If the preview shows a paragraph full of pipe characters instead of a grid, count the pipes in each row.
- Check links and emphasis render as links and bold or italic text, not as visible bracket and asterisk characters.
- Copy the source Markdown from the left pane and paste it into GitHub: into the README file in your editor or the web editor, or into the issue, pull request or comment box. Save your own copy of the source file too, because the editor keeps nothing.
Worked example: a README section, checked before pasting
Take a typical small README section, the kind pasted a hundred times a day:
# Title
Hello **world**
| Name | Age |
| :--- | ---: |
| Ada | 36 |
| Grace | 85 |
In the editor, the heading renders as a heading, the bold word renders bold, and the pipe table renders as a real two-column table with the Age column right-aligned by the ---: separator. The editor's own built-in example confirms the core of this behavior: writing # Title and Hello **world** produces the HTML <h1>Title</h1> and <p>Hello <strong>world</strong></p>, which you can see in the preview and copy from the HTML export box if you ever need the markup instead.
Now imagine the separator row had been forgotten, a very common paste error. In the preview, the table instantly collapses into lines of text separated by pipes, visible at a glance. You add the separator row, watch the grid snap back, and only then paste into GitHub. That is the whole value of the workflow: the mistake costs you ten seconds here instead of a fix-up commit there.
The GFM difference, stated honestly
GitHub does not render plain standard Markdown. It renders GitHub Flavored Markdown, GFM, which starts from the same CommonMark base and adds its own extensions. The editor renders CommonMark-style Markdown via marked, so the shared core (headings, paragraphs, lists, links, images, emphasis, fenced code blocks and pipe tables) behaves the same in both places, and checking that core here is reliable.
The extensions are where you should expect differences. Task lists, the - [ ] checkbox syntax GitHub shows in issues and pull requests, are a GFM extension; the editor's own notes warn that editor-specific extensions like task lists may render differently elsewhere, and that applies in both directions. Autolinked references, mentions and other GitHub conveniences likewise belong to GitHub, not to the Markdown you paste. So use the preview for what it proves: that your standard Markdown is sound. Then let GitHub's own preview tab, where one exists, be the final check for GFM-only features.
Limitations
The preview is a close check, not a guarantee. Because GitHub renders GFM, anything relying on GitHub extensions can look different there, and exact spacing, fonts and colors are GitHub's stylesheet choices, not properties of your Markdown. Judge structure here; judge final appearance on GitHub.
Raw HTML is the other gap. The editor sanitizes its preview and export with DOMPurify, so script tags, event handlers and other active content are stripped before display, and harmless formatting tags pass through. GitHub sanitizes pasted HTML under its own rules, which are not identical, so neither preview can fully speak for the other where raw HTML is involved.
And the practical limit: nothing is saved. Refresh the page and the text is gone. Keep your source Markdown in your own files, in the repo you are about to commit to or a local draft, and treat the editor purely as the checking surface.
Common mistakes
- Copying the rendered preview instead of the source. GitHub wants the Markdown text. Always copy from the left pane; pasting rendered output gives you stripped text or unwanted HTML.
- Skipping the blank line before lists and headings. The single most common reason a pasted list renders as a run-on paragraph. The preview shows it instantly; plain text never does.
- Trusting a table you have not seen rendered. A missing separator row or an unescaped pipe in a cell breaks the whole grid silently. If it is not a grid in the preview, it will not be one on GitHub.
- Assuming a task list check here settles GitHub. Checkboxes are a GFM extension. Verify them in GitHub's own preview before relying on them.
- Leaving the only copy in the editor. Nothing is stored. Save the file yourself before you close the tab.
FAQs
Will the preview match GitHub exactly? Not exactly. The editor renders standard Markdown, CommonMark-style via marked, while GitHub uses its own flavor, GFM. Headings, lists, links, fenced code and pipe tables behave the same, but extensions like task lists may render differently on GitHub.
Does the editor support the tables and code blocks I use in READMEs? Yes. Fenced code blocks and pipe tables render in the preview, as they do in standard Markdown renderers, which makes the editor a reliable check for the two constructs that break most often when pasted blind.
Why does some of my raw HTML disappear in the preview? Because the preview is sanitized with DOMPurify. Harmless formatting tags pass through, but scripts, iframes and inline event handlers are removed by design. GitHub sanitizes pasted HTML its own way, so judge raw HTML on GitHub itself.
Is my draft saved in the editor? No. Nothing is saved: refresh the page and the text is gone. Keep the source Markdown in your own files, and treat the editor as a drafting and checking surface.
Can I get HTML out of the editor instead of Markdown? Yes. The editor offers a sanitized HTML export of what you wrote, copied from the box below the preview. For GitHub you normally paste the Markdown source itself and let GitHub render it.
Conclusion
Paste into GitHub second, not first. A minute in the Markdown Editor catches the collapsed tables, swallowed code blocks and glued lists that plain text hides, and the source you paste is then sound standard Markdown that GitHub renders well. If you are still deciding which format your documentation should live in at all, the companion guide, Markdown vs HTML for Documentation, weighs the two formats directly, and the Developer Tools guides collect the rest of the writing and formatting guides in this series.