THE GITHTML FIELD GUIDE
Why a line of dashes turns Markdown text into a heading
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.
This becomes an underline-style heading
---
This is ordinary paragraph text.
---
## An explicit headingCheck 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.
- Compare the suspicious dash line with the preceding text before changing styling.
- Use a scratch fixture to distinguish an underline heading from an intentional thematic separator.
- Inspect the generated outline after the fix, including existing section links.
- Document the team's heading convention so future separators do not accidentally create new sections.
Sources and further reading
AI-assisted writing with source-linked guidance and illustrative examples. Read our editorial approach or report a correction.