Markdown is a writing shorthand for an HTML fragment
A heading, a paragraph, a list, and a fenced code block are not styles. They are elements: h1–h6, p, ul or ol, and pre. Conversion walks the Markdown document and emits that fragment. The preview paints it; the HTML view is the same tags as text.
Paste the fragment into a page and tidy the surrounding markup in the HTML formatter. Class names on that page belong in the CSS formatter.
Which constructs become which elements
How block structure becomes elements
- A blank line ends a paragraph. A single newline inside a paragraph is a soft break, not a new p.
- One to six # marks at the start of a line are h1 through h6. The number of marks is the level.
- A line that starts with -, *, or a number plus a dot is a list item. Nested items need deeper indent.
- A line of --- or *** on its own is a thematic break, hr, not a text rule you style later.
How emphasis, links, and images are written
- **text** becomes strong. *text* becomes em. The markers must hug the words.
- [label](url) is an anchor. The URL is copied as written, including a relative path.
-  is an image. The alt text is the accessible name, not a caption element.
- A bare URL is not always a link. Autolink is a separate rule from an explicit [label](url).
How fenced code and GFM tables differ from plain paragraphs
- A fence of three backticks wraps a pre/code block. An optional info string such as js names the language, it does not execute the code.
- Four-space indent is also a code block. It is easy to create by accident when a paragraph is indented.
- A GFM table is a header row, a delimiter row of dashes, then body rows. Cells are td or th, not a layout grid.
- Strikethrough with ~~text~~ is a GFM span, del, not part of the original CommonMark core.
Why the preview and the HTML source are the same fragment
- Preview is the browser painting the fragment. Source is that fragment serialized as tags.
- Switching views does not run a second conversion.
- A raw HTML block inside the Markdown is emitted as HTML, not escaped into text.
- The fragment has no html, head, or body wrapper. Those belong to the page you paste into.
Where the fragment is used
README and docs
Headings, lists, and fenced samples become the elements a docs site already styles.
CMS body fields
The source view is the snippet to paste. The preview is only how the fragment paints before your stylesheet.