Skip to content

Theme Classic inconsistently wraps the doc page title into <header> #8476

@cmfcmf

Description

@cmfcmf

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

The theme inconsistently wraps the title of a doc page into <header>: Only when a synthetic title is rendered, it is being wrapped into <header>. Non-synthetic titles are not wrapped into <header>.

Relevant code:

<header>
<Heading as="h1">{syntheticTitle}</Heading>
</header>

Reproducible demo

https://codesandbox.io/s/dazzling-panini-566sqf

Steps to reproduce

Go to "Tutorial Intro" page: Title not wrapped in <header>
Go to "Tutorial - Basics" -> "Create a Page": Title is wrapped in <header>

Expected behavior

The doc title should either always, or never, be wrapped in <header>.

Actual behavior

The doc page title is wrapped in <header> depending on whether it is a synthetic title or not.

Your environment

  • Docusaurus version used: 2.2.0

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its execution

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions