# Why a line of dashes turns Markdown text into a heading

Canonical: https://githtml.com/guides/markdown-setext-heading-confusion
Published: 2026-11-23
Publisher: WaveTech LLC / gitHtml

A line of dashes immediately beneath text can be interpreted as an underline-style heading rather than a divider. If that is not your intent, separate the blocks clearly or use an explicit hash-prefixed heading. Preview nearby lines together, since the preceding paragraph changes how the apparent separator is interpreted.

## Look one line above the surprising result

When a sentence suddenly becomes a large heading, inspect the line immediately below it. A row of dashes may have been added as a visual separator in the raw file. Markdown uses context to distinguish block structures, so evaluating the dash line alone misses the cause. Reduce the example to the sentence and separator, then add surrounding blank lines one at a time. Do not start by reducing the heading's font size in the theme. That hides a structural mistake while leaving the document outline incorrect for navigation, links, and assistive technology.

## Prefer explicit intent in shared authoring

Hash-prefixed headings are often easier for a team to recognize at a glance, especially when prose contains dash-heavy examples or metadata boundaries. This is an editorial convention, not a requirement that underline-style headings are invalid. If the project already uses setext headings consistently, preserve that convention while fixing the ambiguous separator. The fixture demonstrates an unintended heading and a clearly separated divider. Keep separators rare enough to carry meaning. A descriptive subheading usually helps readers more than a horizontal rule when the document is moving to a new topic or task.

````markdown
This becomes an underline-style heading
---

This is ordinary paragraph text.

---

## An explicit heading
````

## Check the outline after the syntax repair

Render the page and inspect its heading list or generated navigation. Confirm that the formerly enlarged sentence is now ordinary text and that legitimate headings remain at their intended levels. Follow any table-of-contents link that referenced the affected area. If you replace an existing heading with prose, consider whether external section links depend on its generated anchor. Review the exported HTML as well as the source preview when a converter is involved. The aim is not merely consistent visual size; it is a document whose structural outline matches the relationships the author intended to communicate. Use a short fixture containing both legitimate heading styles if the repository intentionally supports them. This gives formatters and future contributors a concrete example of what must remain unchanged during cleanup.

1. Compare the suspicious dash line with the preceding text before changing styling.
2. Use a scratch fixture to distinguish an underline heading from an intentional thematic separator.
3. Inspect the generated outline after the fix, including existing section links.
4. Document the team's heading convention so future separators do not accidentally create new sections.

## Sources and further reading

- [CommonMark specification](https://spec.commonmark.org/0.31.2/)

## Related guides

- [Include a pipe character in a Markdown table cell](https://githtml.com/guides/markdown-table-pipe-character)
- [Use Markdown task lists without confusing checks with approval](https://githtml.com/guides/markdown-task-list-status-meaning)
- [Add Markdown section dividers without creating list items](https://githtml.com/guides/markdown-thematic-break-list-conflicts)
- [Use README badges without overstating project health](https://githtml.com/guides/readme-badges-meaning-and-staleness)

Editorial approach: https://githtml.com/guides/about
