Skip to content

First Markdown heading directly following a h1 Markdown heading is rendered as <p> #4634

Closed

Description

@duanwilliam

🐛 Bug Report

A Markdown heading directly following a h1 Markdown heading at the top of the file is rendered as a paragraph.

This seems to only occur when the h1 Markdown heading is the first non-frontmatter content in the file, and is directly followed by another Markdown heading.

Separate title frontmatter does not affect the bug; however, including any content before the initial heading, or directly after (including imports, which are not rendered in the resultant static page) would result in the bug not appearing.

https://codesandbox.io/s/determined-cray-mvy4t?file=/docs/tutorial-extras/test/index.md

Have you read the Contributing Guidelines on issues?

yes

To Reproduce

https://codesandbox.io/s/determined-cray-mvy4t?file=/docs/tutorial-extras/test/index.md

  1. fork the CodeSandbox template / create new Docusaurus site
  2. add a heading directly below the h1 heading for a Markdown page

Expected behavior

The markdown renders properly

Actual Behavior

The heading is rendered as a paragraph instead.

# h1

## h2

### h3

image
image


# h1

import Tabs from '@theme/Tabs';

## h2

### h3

image

Your Environment

Docusaurus version: 2.0.0-alpha.73
https://codesandbox.io/s/determined-cray-mvy4t?file=/docs/tutorial-extras/test/index.md

Reproducible Demo

CodeSandbox:
https://codesandbox.io/s/determined-cray-mvy4t?file=/docs/tutorial-extras/test/index.md

Activity

  1. added
    bug
    status: needs triage
    on Apr 16, 2021
  2. removed
    status: needs triage
    on Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions